win32screenshot 0.0.8 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -2,4 +2,6 @@ coverage
2
2
  rdoc
3
3
  pkg
4
4
  .idea
5
- spec/tmp
5
+ spec/tmp
6
+ .yardoc/
7
+ doc/
File without changes
data/.yardopts ADDED
@@ -0,0 +1,6 @@
1
+ --readme README.rdoc
2
+ --no-private
3
+ --hide-void-return
4
+ --title "Win32::Screenshot"
5
+ --files History.rdoc,LICENSE
6
+ --default-return ""
data/History.rdoc CHANGED
@@ -1,3 +1,10 @@
1
+ = 1.0.0 2010-12-17 - The New Beginning
2
+ * Bundling all necessary libraries/binaries with the gem - ImageMagick and RMagick are no more needed, finally!
3
+ * Using MiniMagick to save images to gif, jpg and png format
4
+ * Simplified and deleted a lot of code causing backwards incompatibility and major API changes!
5
+ Refer to the README.rdoc and documentation for the overview of the new and better API
6
+ * From now on this library is following Semantic Versioning (http://semver.org) rules
7
+
1
8
  = 0.0.8 2010-12-13
2
9
  * Renamed Win32::Screenshot::Util.all_windows to all_desktop_windows (Roger Pack)
3
10
  * Added methods to Win32::Screenshot::Util class (Roger Pack):
data/README.rdoc CHANGED
@@ -1,94 +1,40 @@
1
- = Win32::Screenshot (old name win32screenshot)
1
+ = Win32::Screenshot
2
2
 
3
3
  * http://github.com/jarmo/win32screenshot
4
4
 
5
5
  == DESCRIPTION
6
6
 
7
- Capture Screenshots on Windows with Ruby. This library captures
8
- screenshots in bmp format, but you may use RMagick to convert these to some
9
- other formats like png.
7
+ Capture Screenshots on Windows with Ruby to bmp, gif, jpg or png formats!
8
+
9
+ == INSTALL
10
+
11
+ gem install win32screenshot
10
12
 
11
13
  == SYNOPSIS
12
14
 
13
15
  require 'win32/screenshot'
14
16
 
15
- # take a screenshot of the foreground window
16
- Win32::Screenshot.foreground do |width, height, bmp|
17
- File.open("picture1.bmp", "wb") {|file| file.puts bmp}
18
- end
19
-
20
- # take a screenshot of the area of the foreground where upper left x and y
21
- # coordinates are 0 and 10, width is 100 and height is 200
22
- Win32::Screenshot.foreground_area(0, 10, 100, 200) do |width, height, bmp|
23
- File.open("picture2.bmp", "wb") {|file| file.puts bmp}
24
- end
25
-
26
- # take a screenshot of the screen
27
- Win32::Screenshot.desktop do |width, height, bmp|
28
- File.open("picture3.bmp", "wb") {|file| file.puts bmp}
29
- end
30
-
31
- # take a screenshot of the area of the desktop where upper left x and y
32
- # coordinates are 0 and 10, width is 100 and height is 200
33
- Win32::Screenshot.desktop_area(0, 10, 100, 200) do |width, height, bmp|
34
- File.open("picture4.bmp", "wb") {|file| file.puts bmp}
35
- end
36
-
37
- # take a screenshot of the window, which has a text part of it's title
38
- Win32::Screenshot.window("Internet Explorer") do |width, height, bmp|
39
- File.open("picture5.bmp", "wb") {|file| file.puts bmp}
40
- end
41
-
42
- # take a screenshot of the window, which matches regexp against it's title
43
- Win32::Screenshot.window(/Internet Explorer/) do |width, height, bmp|
44
- File.open("picture6.bmp", "wb") {|file| file.puts bmp}
45
- end
46
-
47
- # take a screenshot of the area of the window where upper left x and y
48
- # coordinates are 0 and 10, width is 100 and height is 200
49
- Win32::Screenshot.window_area("Internet Explorer", 0, 10, 100, 200) do |width, height, bmp|
50
- File.open("picture7.bmp", "wb") {|file| file.puts bmp}
51
- end
52
-
53
- # take a screenshot of the window with specified window handle
54
- Win32::Screenshot.hwnd(window_handle) do |width, height, bmp|
55
- File.open("picture8.bmp", "wb") {|file| file.puts bmp}
56
- end
57
-
58
- # take a screenshot of the area of the window with a window handle
59
- # where upper left x and y
60
- # coordinates are 0 and 10, width is 100 and height is 200
61
- Win32::Screenshot.hwnd_area(window_handle, 0, 10, 100, 200) do |width, height, bmp|
62
- File.open("picture9.bmp", "wb") {|file| file.puts bmp}
63
- end
64
-
65
- # convert a screenshot to the png format with RMagick
66
- require 'rmagick'
67
-
68
- Win32::Screenshot.hwnd(window_handle) do |width, height, bmp|
69
- img = Magick::Image.from_blob(bmp)
70
- png = img[0].to_blob {self.format = 'PNG'}
71
- File.open("picture10.png", "wb") {|file| file.puts png}
72
- end
73
-
74
- #
75
- # Win32::Screenshot has also some utility methods which can be used for various needs
17
+ # Take a screenshot of the window with the specified title
18
+ Win32::Screenshot::Take.of(:window, :title => "Windows Internet Explorer").write("image.bmp")
76
19
 
77
- # enumerate all windows and return their titles and handles
78
- Win32::Screenshot::Util.all_windows # => [["title1", 2345], ["title2", 3456]]
20
+ # Take a screenshot of the foreground
21
+ Win32::Screenshot::Take.of(:foreground).write("image.png")
79
22
 
80
- # retrieve window title for the specified window handle
81
- Win32::Screenshot::Util.window_title(2345) # => "title1"
23
+ # Take a screenshot of the specified window's top-left corner's area
24
+ Win32::Screenshot::Take.of(:window, :title => /internet/i, :area => [10, 10, 20, 20]).write("image.jpg")
82
25
 
83
- # retrieve window handle for the specified title
84
- Win32::Screenshot::Util.window_hwnd("title1") # => 2345
26
+ # Take a screenshot of the window with the specified handle
27
+ Win32::Screenshot::Take.of(:window, :hwnd => 123456).write("image.gif")
85
28
 
86
- # title can be also a regular expression with first matching window retrieved
87
- Win32::Screenshot::Util.window_hwnd(/tit.*1/) # => 2345
29
+ # Take a screenshot of the child window with the specified internal class name
30
+ Win32::Screenshot::Take.of(:rautomation, RAutomation::Window.new(:hwnd => 123456).
31
+ child(:class => "Internet Explorer_Server")).write("image.png")
88
32
 
89
- # retrive dimensions of a window with specified handle in an Array of [width, height]
90
- # might be useful for using with different capture_area methods
91
- Win32::Screenshot::Util.dimensions_for(2345) # => [100, 200]
33
+ # Use the bitmap blob for something else
34
+ image = Win32::Screenshot::Take.of(:window, :hwnd => 123456)
35
+ image.height # => height of the image
36
+ image.width # => width of the image
37
+ image.bitmap # => bitmap blob
92
38
 
93
39
  == Copyright
94
40
 
data/Rakefile CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  require 'rubygems'
4
4
  require 'rake'
5
- require 'os'
6
5
 
7
6
  begin
8
7
  require 'jeweler'
@@ -17,29 +16,20 @@ begin
17
16
  gem.rdoc_options = ["--main", "README.rdoc"]
18
17
 
19
18
  gem.add_dependency "ffi", "~>0"
19
+ gem.add_dependency "mini_magick", "~>3.1"
20
+ gem.add_dependency "rautomation", "~>0.2"
20
21
 
21
- gem.add_development_dependency "rspec", ">= 1.2.9"
22
- gem.add_development_dependency 'os'
23
- if OS.java?
24
- gem.add_development_dependency "rmagick4j"
25
- else
26
- gem.add_development_dependency "rmagick"
27
- end
22
+ gem.add_development_dependency "rspec", "~>2.3"
28
23
  end
29
24
  Jeweler::GemcutterTasks.new
30
25
  rescue LoadError
31
26
  puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
32
27
  end
33
28
 
34
- require 'spec/rake/spectask'
35
- Spec::Rake::SpecTask.new(:spec) do |spec|
36
- spec.libs << 'lib' << 'spec'
37
- spec.spec_files = FileList['spec/**/*_spec.rb']
38
- end
29
+ require 'rspec/core/rake_task'
30
+ RSpec::Core::RakeTask.new(:spec)
39
31
 
40
- Spec::Rake::SpecTask.new(:rcov) do |spec|
41
- spec.libs << 'lib' << 'spec'
42
- spec.pattern = 'spec/**/*_spec.rb'
32
+ RSpec::Core::RakeTask.new(:rcov) do |spec|
43
33
  spec.rcov = true
44
34
  end
45
35
 
@@ -47,15 +37,8 @@ task :spec => :check_dependencies
47
37
 
48
38
  task :default => :spec
49
39
 
50
- require 'rake/rdoctask'
51
- Rake::RDocTask.new do |rdoc|
52
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
53
-
54
- rdoc.rdoc_dir = 'rdoc'
55
- rdoc.title = "Win32::Screenshot #{version}"
56
- rdoc.rdoc_files.include('README*')
57
- rdoc.rdoc_files.include('lib/**/*.rb')
58
- end
40
+ require 'yard'
41
+ YARD::Rake::YardocTask.new
59
42
 
60
43
  desc "Remove all temporary files"
61
44
  task :clobber => [:clobber_rdoc, :clobber_rcov] do
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.8
1
+ 1.0.0
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,101 @@
1
+ Before we get to the text of the license lets just review what the license says in simple terms:
2
+
3
+ It allows you to:
4
+
5
+ * freely download and use ImageMagick software, in whole or in part, for personal, company internal, or commercial purposes;
6
+ * use ImageMagick software in packages or distributions that you create;
7
+ * link against a library under a different license;
8
+ * link code under a different license against a library under this license;
9
+ * merge code into a work under a different license;
10
+ * extend patent grants to any code using code under this license;
11
+ * and extend patent protection.
12
+
13
+ It forbids you to:
14
+
15
+ * redistribute any piece of ImageMagick-originated software without proper attribution;
16
+ * use any marks owned by ImageMagick Studio LLC in any way that might state or imply that ImageMagick Studio LLC endorses your distribution;
17
+ * use any marks owned by ImageMagick Studio LLC in any way that might state or imply that you created the ImageMagick software in question.
18
+
19
+ It requires you to:
20
+
21
+ * include a copy of the license in any redistribution you may make that includes ImageMagick software;
22
+ * provide clear attribution to ImageMagick Studio LLC for any distributions that include ImageMagick software.
23
+
24
+ It does not require you to:
25
+
26
+ * include the source of the ImageMagick software itself, or of any modifications you may have made to it, in any redistribution you may assemble that includes it;
27
+ * submit changes that you make to the software back to the ImageMagick Studio LLC (though such feedback is encouraged).
28
+
29
+ A few other clarifications include:
30
+
31
+ * ImageMagick is freely available without charge;
32
+ * you may include ImageMagick on a DVD as long as you comply with the terms of the license;
33
+ * you can give modified code away for free or sell it under the terms of the ImageMagick license or distribute the result under a different license, but you need to acknowledge the use of the ImageMagick software;
34
+ * the license is compatible with the GPL V3.
35
+ * when exporting the ImageMagick software, review its export classification.
36
+
37
+ The legally binding and authoritative terms and conditions for use, reproduction, and distribution of ImageMagick follow:
38
+
39
+ Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available.
40
+
41
+ 1. Definitions.
42
+
43
+ License shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
44
+
45
+ Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
46
+
47
+ Legal Entity shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, control means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
48
+
49
+ You (or Your) shall mean an individual or Legal Entity exercising permissions granted by this License.
50
+
51
+ Source form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
52
+
53
+ Object form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
54
+
55
+ Work shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
56
+
57
+ Derivative Works shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
58
+
59
+ Contribution shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as Not a Contribution.
60
+
61
+ Contributor shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
62
+
63
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
64
+
65
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
66
+
67
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
68
+
69
+ 1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
70
+ 2. You must cause any modified files to carry prominent notices stating that You changed the files; and
71
+ 3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
72
+ 4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
73
+
74
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
75
+
76
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
77
+
78
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
79
+
80
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
81
+
82
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
83
+
84
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
85
+ APPENDIX: How to apply the ImageMagick License to your work
86
+
87
+ To apply the ImageMagick License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
88
+
89
+ Copyright [yyyy] [name of copyright owner]
90
+
91
+ Licensed under the ImageMagick License (the "License"); you may not use
92
+ this file except in compliance with the License. You may obtain a copy
93
+ of the License at
94
+
95
+ http://www.imagemagick.org/script/license.php
96
+
97
+ Unless required by applicable law or agreed to in writing, software
98
+ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
99
+ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
100
+ License for the specific language governing permissions and limitations
101
+ under the License.
data/ext/X11.dll ADDED
Binary file
data/ext/identify.exe ADDED
Binary file
data/ext/mogrify.exe ADDED
Binary file
data/ext/msvcr100.dll ADDED
Binary file
data/ext/vcomp100.dll ADDED
Binary file
@@ -1,95 +1,14 @@
1
+ require 'ffi'
2
+ require 'stringio' # this is needed for MiniMagick for now
3
+ require 'mini_magick'
4
+ require 'rautomation'
5
+
6
+ require File.dirname(__FILE__) + '/screenshot/extensions/rautomation/adapter/ffi/functions'
7
+ require File.dirname(__FILE__) + '/screenshot/extensions/rautomation/adapter/ffi/window'
8
+ require File.dirname(__FILE__) + '/screenshot/take'
9
+ require File.dirname(__FILE__) + '/screenshot/image'
1
10
  require File.dirname(__FILE__) + '/screenshot/bitmap_maker'
2
- require File.dirname(__FILE__) + '/util'
3
11
 
4
- module Win32
5
- # Captures screenshots with Ruby on Windows
6
- class Screenshot
7
- class << self
8
-
9
- # captures foreground
10
- def foreground(&proc)
11
- hwnd = BitmapMaker.foreground_window
12
- BitmapMaker.capture_all(hwnd, &proc)
13
- end
14
-
15
- # captures area of the foreground
16
- # where *x1* and *y1* are 0 in the upper left corner and
17
- # *x2* specifies the width and *y2* the height of the area to be captured
18
- def foreground_area(x1, y1, x2, y2, &proc)
19
- hwnd = BitmapMaker.foreground_window
20
- validate_coordinates(hwnd, x1, y1, x2, y2)
21
- BitmapMaker.capture_area(hwnd, x1, y1, x2, y2, &proc)
22
- end
23
-
24
- # captures visible view of the screen
25
- #
26
- # to make screenshot of the real desktop, all
27
- # windows must be minimized before
28
- def desktop(&proc)
29
- hwnd = BitmapMaker.desktop_window
30
- BitmapMaker.capture_all(hwnd, &proc)
31
- end
32
-
33
- # captures area of the visible view of the screen
34
- # where *x1* and *y1* are 0 in the upper left corner and
35
- # *x2* specifies the width and *y2* the height of the area to be captured
36
- #
37
- # to make screenshot of the real desktop, all
38
- # windows must be minimized before
39
- def desktop_area(x1, y1, x2, y2, &proc)
40
- hwnd = BitmapMaker.desktop_window
41
- validate_coordinates(hwnd, x1, y1, x2, y2)
42
- BitmapMaker.capture_area(hwnd, x1, y1, x2, y2, &proc)
43
- end
44
-
45
- # captures window with a *title_query* and waits *pause* (by default is 0.5)
46
- # seconds after trying to set window to the foreground
47
- def window(title_query, pause=0.5, &proc)
48
- hwnd = Util.window_hwnd(title_query)
49
- hwnd(hwnd, pause, &proc)
50
- end
51
-
52
- # captures area of the window with a *title_query*
53
- # where *x1* and *y1* are 0 in the upper left corner and
54
- # *x2* specifies the width and *y2* the height of the area to be captured
55
- def window_area(title_query, x1, y1, x2, y2, pause=0.5, &proc)
56
- hwnd = Util.window_hwnd(title_query)
57
- hwnd_area(hwnd, x1, y1, x2, y2, pause, &proc)
58
- end
59
-
60
- # captures by window handle
61
- def hwnd(hwnd, pause=0.5, &proc)
62
- BitmapMaker.prepare_window(hwnd, pause)
63
- BitmapMaker.capture_all(hwnd, &proc)
64
- end
65
-
66
- # captures area of the window with a handle of *hwnd*
67
- # where *x1* and *y1* are 0 in the upper left corner and
68
- # *x2* specifies the width and *y2* the height of the area to be captured
69
- def hwnd_area(hwnd, x1, y1, x2, y2, pause=0.5, &proc)
70
- validate_coordinates(hwnd, x1, y1, x2, y2)
71
- BitmapMaker.prepare_window(hwnd, pause)
72
- BitmapMaker.capture_area(hwnd, x1, y1, x2, y2, &proc)
73
- end
74
-
75
- private
76
-
77
- def validate_coordinates(hwnd, *coords)
78
- specified_coordinates = coords.join(', ')
79
- if coords.any? {|c| c < 0}
80
- raise "specified coordinates (#{specified_coordinates}) are invalid - cannot be negative!"
81
- end
82
- x1, y1, x2, y2 = *coords
83
- if x1 >= x2 || y1 >= y2
84
- raise "specified coordinates (#{specified_coordinates}) are invalid - cannot have x1 > x2 or y1 > y2!"
85
- end
86
-
87
- max_width, max_height = Util.dimensions_for(hwnd)
88
- if x2 > max_width || y2 > max_height
89
- raise "specified coordinates (#{specified_coordinates}) are invalid - maximum are x2=#{max_width} and y2=#{max_height}!"
90
- end
91
- end
92
- end
93
-
94
- end
95
- end
12
+ # environment variables for bundled MiniMagick
13
+ ENV["PATH"] = "#{File.dirname(__FILE__) + "/../../ext"};#{ENV["PATH"]}"
14
+ ENV["MAGICK_CODER_MODULE_PATH"] = File.dirname(__FILE__) + "/../../ext/modules/coders"