Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solid fill class #105

Open
wants to merge 78 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
24718a6
Update gemspec for 2.13.3.rc1 release
bf4 Jul 28, 2014
ee456dc
Update gemspec link to gemhome org
bf4 Aug 1, 2014
ffcd224
Add my email address since at least it's valid
bf4 Aug 1, 2014
0fe89ec
Bump to 2.13.3 and spike minimal rake release task
bf4 Aug 1, 2014
3f5f527
Enable Travis CI builds
vassilevsky Aug 1, 2014
99cc7dd
Add Rake test task (from Bundler template)
vassilevsky Aug 1, 2014
6366e9f
Rename test file according to Test::Unit conventions
vassilevsky Aug 1, 2014
71886e1
Compile the C extension before testing
vassilevsky Aug 1, 2014
5f5ae93
Remove test/unit monkeypatch that test output really noisy
bf4 Aug 2, 2014
5bc357a
Correct test path to IMAGES_DIR
bf4 Aug 2, 2014
0ff2b5e
Add missing image with ICC profile
bf4 Aug 2, 2014
72ebf4e
Update README with travis badge
bf4 Aug 2, 2014
8da3906
Tidy up the README
linduxed Aug 2, 2014
3b9acb8
Merge pull request #89 from gemhome/mm-touch_up_readme
bf4 Aug 2, 2014
d5b3618
Let the default gem require process work on case-sensitive file systems
vassilevsky Aug 4, 2014
868ee13
Fix initial memory limit test
vassilevsky Aug 10, 2014
98cf62d
Do not test machine and OS-specific integers
vassilevsky Aug 10, 2014
ca6257b
Test if default limits are somewhat reasonable
vassilevsky Aug 10, 2014
bb19f18
Remove obsolete comment
vassilevsky Aug 10, 2014
ba8df86
Merge pull request #91 from vassilevsky/limits-testing
ioquatix Aug 11, 2014
73927fe
Fixed: build error on Windows x64 (with ImageMagick 6.8.0-10 or Image…
u338steven Aug 14, 2014
cce8fd6
Merge pull request #94 from u338steven/patch-1
ioquatix Aug 14, 2014
39fa718
Test on multiple versions of Ruby.
ioquatix Aug 11, 2014
0a06623
Fix pixel hash test
vassilevsky Aug 15, 2014
6e0d95a
Process the return value of Pixel_hash() with UINT2NUM
vassilevsky Aug 15, 2014
905bbfe
Merge pull request #95 from gemhome/pixel-hash-test-fix
ioquatix Aug 15, 2014
363e4e5
Fixed: build error with ImageMagick 6.8.8
u338steven Aug 15, 2014
0f1721f
LABColorspace -> LabColorspace
u338steven Aug 15, 2014
2ffc923
MaxRGB -> QuantumRange
u338steven Aug 15, 2014
089ce26
QuantumDepth -> MAGICKCORE_QUANTUM_DEPTH
u338steven Aug 15, 2014
bcd4a07
Move @@tmpnam test to a separate file for isolation
vassilevsky Aug 15, 2014
f95fc6b
Fixed: test_convolve(Image2_UT) in Image2.rb fails #72
u338steven Aug 15, 2014
8d9bad7
Fixed: test_export_pixels_to_str(Image2_UT) in Image2.rb fails
u338steven Aug 15, 2014
92fab8d
Fixed: test_resample(Image3_UT) in Image3.rb fails #74
u338steven Aug 15, 2014
fc24860
Merge pull request #100 from u338steven/patch-4
ioquatix Aug 16, 2014
667032a
Merge pull request #97 from gemhome/tmpnam-test-fix
ioquatix Aug 16, 2014
98ad048
Merge pull request #98 from u338steven/patch-2
ioquatix Aug 16, 2014
98c246d
Merge pull request #99 from u338steven/patch-3
ioquatix Aug 16, 2014
3716dca
Merge pull request #96 from u338steven/patch-1
ioquatix Aug 16, 2014
071c484
Fixed: test_colorspace(Image_Attributes_UT) in Image_attributes.rb fa…
u338steven Aug 16, 2014
e98ff45
Fixed: related x_resolution, y_resolution
u338steven Aug 16, 2014
863b11a
Test against ImageMagick 6.6.9, 6.7.7, 6.7.9 and 6.8.9 (both with and…
ioquatix Aug 16, 2014
fcce4e8
Reduced excessive test matrix size for non-essential builds.
ioquatix Aug 16, 2014
6169986
Fixed: removed tests for the default value
u338steven Aug 16, 2014
30dcd52
ImageMagick now using releases directory.
ioquatix Aug 16, 2014
7e695ac
Merge pull request #102 from u338steven/patch-6
ioquatix Aug 16, 2014
2a9424e
Merge branch 'master' of git://github.com/gemhome/rmagick into patch-5
u338steven Aug 17, 2014
81d105b
Fixed: test_colorspace fails (across all versions)
u338steven Aug 17, 2014
57c8f34
Merge pull request #101 from u338steven/patch-5
ioquatix Aug 17, 2014
ffd530f
Fixed: test_gamma(Image_Attributes_UT) in Image_attributes.rb fails #77
u338steven Aug 19, 2014
daa5915
Fixed: test_rendering_intent(Image_Attributes_UT) in Image_attributes…
u338steven Aug 19, 2014
7ebfb3d
Fixed: test_total_colors(Image_Attributes_UT) in Image_attributes.rb …
u338steven Aug 21, 2014
48bb1df
Fixed: test_number_colors(Image_Attributes_UT) in Image_attributes.rb…
u338steven Aug 21, 2014
8d1ddec
Merge pull request #106 from u338steven/patch-8
ioquatix Aug 22, 2014
6b5b1bd
Merge pull request #107 from u338steven/patch-7
ioquatix Aug 22, 2014
78544de
Merge pull request #108 from u338steven/patch-9
ioquatix Aug 22, 2014
e1d553d
Merge pull request #109 from u338steven/patch-10
ioquatix Aug 22, 2014
c77778b
Fixed: type mismatch on windows
u338steven Aug 22, 2014
4150d8c
Fixed: build error with ImageMagick 6.8.9 (when deprecated functions …
u338steven Aug 23, 2014
ff94018
Merge pull request #112 from u338steven/patch-13
ioquatix Aug 23, 2014
866a926
Merge branch 'patch-12' of github.com:u338steven/rmagick into u338ste…
ioquatix Aug 23, 2014
6f9638f
Merge branch 'u338steven-patch-12'
ioquatix Aug 23, 2014
f4a345c
Fixed: test_each_profile(Image2_UT) in Image2.rb fails #73
u338steven Aug 24, 2014
f91a44a
Fixed: crash trying to 'test_monitor' on Windows(x64).(Info.rb)
u338steven Aug 24, 2014
ca71ab8
Fixed: test_from_blob(ImageList2_UT) in ImageList2.rb fails (on Windows)
u338steven Aug 24, 2014
25020f6
Merge pull request #113 from u338steven/patch-14
ioquatix Aug 25, 2014
54efe84
Fixed: crash trying to Image#write, ImageList#write on Windows (T_FILE)
u338steven Aug 26, 2014
6ef5686
Fixed: test_from_hsla(Pixel_UT) in Pixel.rb fails #87
u338steven Aug 27, 2014
8881958
Merge pull request #115 from u338steven/patch-16
ioquatix Aug 28, 2014
ce1ae00
Merge pull request #114 from u338steven/patch-15
ioquatix Aug 30, 2014
dcf3cae
Merge pull request #117 from u338steven/patch-11
ioquatix Aug 30, 2014
18ee3f9
Merge pull request #119 from u338steven/patch-17
ioquatix Sep 7, 2014
72159df
6.8.9-6 is now testing fine, so lets make it non-optional.
ioquatix Sep 7, 2014
163723e
Allow MagickCore6 from Magick-config
chulkilee Feb 11, 2013
d508c0b
Merge pull request #120 from chulkilee/fix-extconf
ioquatix Sep 8, 2014
1b1ff06
Quotes for correct path of font file
markotom Sep 9, 2014
e919070
Merge pull request #121 from markotom/master
ioquatix Sep 9, 2014
7a84e91
New class SolidFill in order to fill image with monochromatic backgro…
VorontsovIE Sep 15, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
*.gem
*.rbc
.bundle
.config
.yardoc
Gemfile.lock
InstalledFiles
_yardoc
coverage
lib/bundler/man
pkg
rdoc
spec/reports
test/tmp
test/version_tmp
tmp
*.bundle
*.so
*.o
*.a
mkmf.log
51 changes: 51 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
language: ruby
env:
# Currently successful release
- IMAGEMAGICK_VERSION=6.6.9-10
# Ubuntu's current stable release
- IMAGEMAGICK_VERSION=6.7.7-10
# Latest 6.7 release
- IMAGEMAGICK_VERSION=6.7.9-10
# Latest 6.8 release
- IMAGEMAGICK_VERSION=6.8.9-6
# Try with HDRI support, we don't mind if this fails currently.
- IMAGEMAGICK_VERSION=6.8.9-6 CONFIGURE_OPTIONS=--enable-hdri
before_install:
- dpkg --list imagemagick
- sudo apt-get remove imagemagick
- sudo apt-get install build-essential libx11-dev libxext-dev zlib1g-dev libpng12-dev libjpeg-dev libfreetype6-dev libxml2-dev
- sudo apt-get build-dep imagemagick
- wget http://www.imagemagick.org/download/releases/ImageMagick-${IMAGEMAGICK_VERSION}.tar.gz
- tar -xzvf ImageMagick-${IMAGEMAGICK_VERSION}.tar.gz
- cd ImageMagick-${IMAGEMAGICK_VERSION}
- ./configure --prefix=/usr $CONFIGURE_OPTIONS
- sudo make install
- cd ..
- sudo ldconfig
rvm:
- 1.9
- 2.0
- 2.1
matrix:
exclude:
# - rvm: 1.9
# env: IMAGEMAGICK_VERSION=6.7.7-10
- rvm: 1.9
env: IMAGEMAGICK_VERSION=6.7.9-10
# - rvm: 1.9
# env: IMAGEMAGICK_VERSION=6.8.9-6
- rvm: 1.9
env: IMAGEMAGICK_VERSION=6.8.9-6 CONFIGURE_OPTIONS=--enable-hdri
- rvm: 2.0
env: IMAGEMAGICK_VERSION=6.7.7-10
- rvm: 2.0
env: IMAGEMAGICK_VERSION=6.7.9-10
- rvm: 2.0
env: IMAGEMAGICK_VERSION=6.8.9-6
- rvm: 2.0
env: IMAGEMAGICK_VERSION=6.8.9-6 CONFIGURE_OPTIONS=--enable-hdri
allow_failures:
- env: IMAGEMAGICK_VERSION=6.7.7-10
- env: IMAGEMAGICK_VERSION=6.7.9-10
#- env: IMAGEMAGICK_VERSION=6.8.9-6
- env: IMAGEMAGICK_VERSION=6.8.9-6 CONFIGURE_OPTIONS=--enable-hdri
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source 'https://rubygems.org'

# Specify your gem's dependencies in rmagick.gemspec
gemspec
15 changes: 0 additions & 15 deletions README

This file was deleted.

27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# RMagick

[![Build Status](https://travis-ci.org/gemhome/rmagick.svg?branch=master)](https://travis-ci.org/gemhome/rmagick)

This is the official fork of RMagick. The decision to create a fork [originated here](https://github.com/rmagick/rmagick/issues/18#issuecomment-50022523), where you can read more about why it happened.

## Installation

Add the following to your `Gemfile`:
```ruby
gem 'rmagick'
```

Then run this:
```sh
bundle install
```

If you don't use a `Gemfile`, install it manually like this:
```sh
gem install rmagick
```

Require RMagick in your project as follows:
```ruby
require 'rmagick'
```
55 changes: 55 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# note, there are other, legacy tasks in build_tarball.rake
# thate currently are run by e.g.
# rake -f build_tarball.rake clean release=RMagick_2-13-1
# rake -f build_tarball.rake release=RMagick_2-13-1
require './lib/rmagick/version'
require 'fileutils'
desc "build and push gem, tag and push repo"
task "release" do
sh("git diff --exit-code")
abort "Git repo not clean" unless $?.success?
sh("git diff-index --quiet --cached HEAD")
abort "Git repo not commited" unless $?.success?
version = Magick::VERSION
# e.g. 2.13.3 becomes RMagick_2-13-3
version_tag = "RMagick_#{version.gsub(".","-")}"
# e.g. 2.13.3 becomes rmagick-2.13.3.gem
gem_name = "rmagick-#{version}.gem"

# build gem
sh "gem build -V rmagick.gemspec"
if $?.success?
base = File.expand_path('..', __FILE__)
FileUtils.mkdir_p(File.join(base, 'pkg'))
FileUtils.mv(File.join(base, gem_name), 'pkg')
# push gem
sh "gem push #{File.join(base, 'pkg', gem_name)}"
if $?.success?
sh "git tag -a -m \"Version #{version}\" #{version_tag}"
STDOUT.puts "Tagged #{version_tag}."
sh "git push"
sh "git push --tags"
else
abort "tagging abd pushing gem failed"
end

else
STDERR.puts "Could not build gem"
exit $?.exitstatus
end
end

require 'rake/extensiontask'
require 'rake/testtask'

Rake::ExtensionTask.new('RMagick2') do |ext|
ext.ext_dir = 'ext/RMagick'
end

Rake::TestTask.new(:test) do |t|
t.libs << 'test'
end

task :test => :compile

task :default => :test
Binary file added doc/ex/images/image_with_profile.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc/ex/mask.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@

# Use the #level method to darken the image under the black part of the mask.

img = img.level(0, Magick::MaxRGB, 0.50)
img = img.level(0, Magick::QuantumRange, 0.50)
img.write('mask.jpg')

2 changes: 1 addition & 1 deletion examples/identify.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def identify
puts "\t\tGray: #{channel_depth(Magick::GrayChannel)}-bits\n"
puts "\t\tOpacity: #{channel_depth(Magick::OpacityChannel)}-bits\n" if matte
end
scale = Magick::QuantumRange / (Magick::QuantumRange >> (Magick::QuantumDepth-channel_depth))
scale = Magick::QuantumRange / (Magick::QuantumRange >> (Magick::MAGICKCORE_QUANTUM_DEPTH-channel_depth))
puts "\tChannel statistics:\n"
case color_space
when Magick::RGBColorspace
Expand Down
15 changes: 13 additions & 2 deletions ext/RMagick/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,11 @@ def check_partial_imagemagick_versions()
`convert -version` =~ /Version: ImageMagick (\d+\.\d+\.\d+)-\d+ /
abort "Unable to get ImageMagick version" unless $1
$magick_version = $1
$LOCAL_LIBS = '-lCORE_RL_magick_ -lX11'
if RUBY_PLATFORM =~ /x64/
$LOCAL_LIBS = '-lCORE_RL_magick_'
else
$LOCAL_LIBS = '-lCORE_RL_magick_ -lX11'
end

else # mswin

Expand Down Expand Up @@ -197,7 +201,7 @@ def check_partial_imagemagick_versions()

if RUBY_PLATFORM !~ /mswin|mingw/

unless `Magick-config --libs`[/\bl\s*(MagickCore|Magick)\b/]
unless `Magick-config --libs`[/\bl\s*(MagickCore|Magick)6?\b/]
exit_failure "Can't install RMagick #{RMAGICK_VERS}. " +
"Can't find the ImageMagick library or one of the dependent libraries. " +
"Check the mkmf.log file for more detailed information.\n"
Expand All @@ -212,10 +216,13 @@ def check_partial_imagemagick_versions()
"AutoGammaImageChannel", # 6.5.5-1
"AutoLevelImageChannel", # 6.5.5-1
"BlueShiftImage", # 6.5.4-3
"ColorMatrixImage", # 6.6.1-0
"ConstituteComponentTerminus", # 6.5.7-9
"DeskewImage", # 6.4.2-5
"DestroyConstitute", # 6.5.7-9(deprecated)
"EncipherImage", # 6.3.8-6
"EqualizeImageChannel", # 6.3.6-9
"EvaluateImages", # 6.8.6-4
"FloodfillPaintImage", # 6.3.7
"FunctionImageChannel", # 6.4.8-8
"GetAuthenticIndexQueue", # 6.4.5-6
Expand All @@ -230,12 +237,16 @@ def check_partial_imagemagick_versions()
"OpaquePaintImageChannel", # 6.3.7-10
"QueueAuthenticPixels", # 6.4.5-6
"RemapImage", # 6.4.4-0
"RemapImages", # 6.4.4-0
"RemoveImageArtifact", # 6.3.6
"RotationalBlurImage", # 6.8.8-9
"RotationalBlurImageChannel", # 6.8.8-9
"SelectiveBlurImageChannel", # 6.5.0-3
"SetImageAlphaChannel", # 6.3.6-9
"SetImageArtifact", # 6.3.6
"SetMagickMemoryMethods", # 6.4.1
"SparseColorImage", # 6.3.6-?
"StatisticImage", # 6.6.8-6
"SyncAuthenticPixels", # 6.4.5-6
"TransformImageColorspace", # 6.5.1
"TransparentPaintImage", # 6.3.7-10
Expand Down
30 changes: 15 additions & 15 deletions ext/RMagick/rmagick.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ VALUE
Magick_colors(VALUE class)
{
const ColorInfo **color_info_list;
unsigned long number_colors, x;
size_t number_colors, x;
volatile VALUE ary;
ExceptionInfo exception;
ExceptionInfo *exception;

GetExceptionInfo(&exception);
exception = AcquireExceptionInfo();

color_info_list = GetColorInfoList("*", &number_colors, &exception);
color_info_list = GetColorInfoList("*", &number_colors, exception);
CHECK_EXCEPTION()
(void) DestroyExceptionInfo(&exception);
(void) DestroyExceptionInfo(exception);


if (rb_block_given_p())
Expand Down Expand Up @@ -82,14 +82,14 @@ VALUE
Magick_fonts(VALUE class)
{
const TypeInfo **type_info;
unsigned long number_types, x;
size_t number_types, x;
volatile VALUE ary;
ExceptionInfo exception;
ExceptionInfo *exception;

GetExceptionInfo(&exception);
type_info = GetTypeInfoList("*", &number_types, &exception);
exception = AcquireExceptionInfo();
type_info = GetTypeInfoList("*", &number_types, exception);
CHECK_EXCEPTION()
(void) DestroyExceptionInfo(&exception);
(void) DestroyExceptionInfo(exception);

if (rb_block_given_p())
{
Expand Down Expand Up @@ -166,18 +166,18 @@ VALUE
Magick_init_formats(VALUE class)
{
const MagickInfo **magick_info;
unsigned long number_formats, x;
size_t number_formats, x;
volatile VALUE formats;
ExceptionInfo exception;
ExceptionInfo *exception;

class = class; // defeat "never referenced" message from icc
formats = rb_hash_new();

// IM 6.1.3 added an exception argument to GetMagickInfoList
GetExceptionInfo(&exception);
magick_info = GetMagickInfoList("*", &number_formats, &exception);
exception = AcquireExceptionInfo();
magick_info = GetMagickInfoList("*", &number_formats, exception);
CHECK_EXCEPTION()
(void) DestroyExceptionInfo(&exception);
(void) DestroyExceptionInfo(exception);


for (x = 0; x < number_formats; x++)
Expand Down
14 changes: 7 additions & 7 deletions ext/RMagick/rmagick.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@


// Handle Quantum <-> Ruby Numeric object conversion
#if (QuantumDepth == 8 || QuantumDepth == 16)
#if (MAGICKCORE_QUANTUM_DEPTH == 8 || MAGICKCORE_QUANTUM_DEPTH == 16)
#define QUANTUM2NUM(q) INT2FIX((q)) /**< Quantum -> Ruby Numeric conversion */
#define NUM2QUANTUM(n) (Quantum)NUM2UINT((n)) /**< Quantum <- Ruby Numeric conversion */
#elif (QuantumDepth == 32)
#elif (MAGICKCORE_QUANTUM_DEPTH == 32)
#define QUANTUM2NUM(q) UINT2NUM((q)) /**< Quantum -> Ruby Numeric conversion */
#define NUM2QUANTUM(n) (Quantum)NUM2UINT((n)) /**< Quntum <- Ruby Numeric conversion */
#elif (QuantumDepth == 64)
#elif (MAGICKCORE_QUANTUM_DEPTH == 64)
#define QUANTUM2NUM(q) ULL2NUM((q)) /**< Quantum -> Ruby Numeric conversion */
#define NUM2QUANTUM(n) (Quantum)NUM2ULL((n)) /**< Quntum <- Ruby Numeric conversion */
#else
#error Specified QuantumDepth is not supported.
#error Specified MAGICKCORE_QUANTUM_DEPTH is not supported.
#endif
//! Convert user-supplied objects to Quantum
#define APP2QUANTUM(n) rm_app2quantum((n))
Expand Down Expand Up @@ -457,7 +457,7 @@ EXTERN ID rm_ID_y; /**< "y" */
Handle warnings & errors
*/
//! Handle warnings & errors
#define CHECK_EXCEPTION() rm_check_exception(&exception, NULL, RetainOnError);
#define CHECK_EXCEPTION() rm_check_exception(exception, NULL, RetainOnError);


/*
Expand Down Expand Up @@ -634,9 +634,9 @@ Pixel_##_cmyk_channel_(VALUE self) \
#define END_ENUM }

//! Define a Magick module constant
#if QuantumDepth == 64
#if MAGICKCORE_QUANTUM_DEPTH == 64
#define DEF_CONST(constant) rb_define_const(Module_Magick, #constant, ULL2NUM(constant))
#else // QuantumDepth == 8, 16, 32
#else // MAGICKCORE_QUANTUM_DEPTH == 8, 16, 32
#define DEF_CONST(constant) rb_define_const(Module_Magick, #constant, UINT2NUM(constant))
#endif

Expand Down
Loading