win32screenshot 1.0.10 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: e67d3adc93d46bc811c37b5a16b5621bd0605931
4
- data.tar.gz: 5831adb5550395460f7f9cddf0305e36300276ec
2
+ SHA256:
3
+ metadata.gz: af9b9611193b8f4cc8d98745a6130cf16fe6fb2674e26e76a3745e34cf8de959
4
+ data.tar.gz: 278502bd7bc360a2813db04f590ee82b706eaee894cd6ce252227acb0765676e
5
5
  SHA512:
6
- metadata.gz: b271c7ef3008482803fec59dfcf13d29966d7401f388bb837afebb4b47cb46bea1ac222727b1ec56c14abff474c62350878cd60007a39bc60f19370a1885d241
7
- data.tar.gz: b2f0b0d9d1344701b736e1ebb3fe8c0c4c8522be8665b68b6cc357d0191b6c0b7ed26d0d61c1f427e8298eb8c6f455290adc3102dca926bc8193547109e95f59
6
+ metadata.gz: 636cfeb1613a8b84a000b1c5b449168cf398306bfbe47de4ac882ad6bfbb5e461055e921b63cc17ad4bd1f915fc6e13c582158da5518f835813f41b55662f947
7
+ data.tar.gz: 1209209433553596e94ed0a65c67becbb652756eca79ac3ff00777e5cc8b29ea8faa9eea42312303d048bd5121a985622e5aac93db1a55e86242f3fa196d92a4
data/.yardopts CHANGED
@@ -1,6 +1,6 @@
1
- --readme README.rdoc
1
+ --readme README.md
2
2
  --no-private
3
3
  --hide-void-return
4
4
  --title "Win32::Screenshot"
5
- --files History.rdoc,LICENSE
5
+ --files CHANGES.md,LICENSE
6
6
  --default-return ""
data/CHANGES.md ADDED
@@ -0,0 +1,177 @@
1
+ # 3.1.0 2022-02-05
2
+ * Update dependencies
3
+
4
+ # 3.0.0 2019-12-11
5
+ * Use RAutomation 1.0.0 as its dependency to be able to use newer ffi.
6
+ * Update bundled ImageMagick to 7.0.9-8.
7
+ * Update MiniMagick dependency.
8
+
9
+ # 2.1.0 2016-01-09
10
+ * Add Image#write! for overwriting images.
11
+ * Update MiniMagick dependency.
12
+ * Update bundled ImageMagick version to 6.9.3-0-portable-Q16-x86.
13
+
14
+
15
+ # 2.0.0 2015-06-28
16
+ * Update MiniMagick dependency due to CVE-2013-2616.
17
+ * Update bundled ImageMagick version to 6.9.1-6-Q16-x86.
18
+
19
+
20
+ # 1.0.10 2013-11-01
21
+ * Add license to gemspec.
22
+
23
+
24
+ # 1.0.9 2013-10-05
25
+ * Set mini_magick 3.5.0 as a dependency because 3.6.0 is broken.
26
+
27
+
28
+ # 1.0.8 2013-03-09
29
+ * Loosen up dependencies
30
+
31
+
32
+ # 1.0.7 2012-02-23
33
+ * Bump RAutomation dependency
34
+
35
+
36
+ # 1.0.6 2011-10-16
37
+ * Screenshot will be taken of the whole window instead of client area - e.g.
38
+ with title bar and such.
39
+ * Added :context option to specify which area to take screenshot of -
40
+ possible values are :window or :client
41
+ Win32::Screenshot::Take.of(:window, :hwnd => 1234, :context => :client)
42
+
43
+
44
+ # 1.0.5 2011-08-18
45
+ * Minor output message change
46
+
47
+
48
+ # 1.0.4 2011-06-18
49
+ * Make sure that mini_magick 3.2 is used due to bug in 3.3-s dependency
50
+ subexec https://github.com/nulayer/subexec/issues/4
51
+
52
+
53
+ # 1.0.3 2011-04-17
54
+ * Try to take a screenshot of the window even if the activation of that
55
+ window fails.
56
+
57
+
58
+ # 1.0.2 2011-01-20
59
+ * Fixed to work with RAutomation version 0.4
60
+
61
+
62
+ # 1.0.1 2010-12-18
63
+ * Increased RAutomation dependency for version 0.3.0 due to it's new
64
+ Window#child method
65
+ * Making sure that RAutomation's Ffi adapter is always used
66
+
67
+
68
+ # 1.0.0 2010-12-17 - The New Beginning
69
+ * Bundling all necessary libraries/binaries with the gem - ImageMagick and
70
+ RMagick are no more needed, finally!
71
+ * Using MiniMagick to save images to gif, jpg and png format
72
+ * Simplified and deleted a lot of code causing backwards incompatibility and
73
+ major API changes!
74
+ Refer to the README.rdoc and documentation for the overview of the new and better API
75
+
76
+ * From now on this library is following Semantic Versioning
77
+ (http://semver.org) rules
78
+
79
+
80
+ # 0.0.8 2010-12-13
81
+ * Renamed Win32::Screenshot::Util.all_windows to all_desktop_windows (Roger
82
+ Pack)
83
+ * Added methods to Win32::Screenshot::Util class (Roger Pack):
84
+ * window_process_id
85
+ * window_class
86
+ * windows_hierarchy_with_info
87
+ * get_info
88
+ * location_of
89
+
90
+ * It's possible to search windows also by class name (Roger Pack)
91
+ * Child windows will be also searched for (Roger Pack)
92
+
93
+
94
+ # 0.0.7 2010-08-18
95
+ * Supports now fully JRuby, 1.9.1 and 1.9.2 MRI!
96
+
97
+
98
+ # 0.0.6 2010-08-07
99
+ * Trying to bring window to the foreground more aggressively (Roger Pack)
100
+ * Added utility class Win32::Screenshot.Util with some helper methods not
101
+ related directly with taking of the screenshots:
102
+ * all_windows - enumerates all windows and returns their titles and
103
+ window handles as an Array (Roger Pack)
104
+ * window_title(hwnd) - returns title of the window for specified handle
105
+ (Jarmo Pertman)
106
+ * window_hwnd(title_query) - returns handle of the window for specified
107
+ title (Jarmo Pertman)
108
+ * dimensions_for(hwnd) - returns a width and height for a window with
109
+ specified handle (Jarmo Pertman)
110
+
111
+ * Removed a file 'win32screenshot.rb' which was solely used for displaying
112
+ deprecation warnings for versions older than 0.0.4. Make sure than from
113
+ now on all require statements require 'win32/screenshot'!
114
+
115
+
116
+ ## Bug Fixes:
117
+ * Fixed usages of gdi32.dll BitBlt (Roger Pack)
118
+ * It was impossible to specify correctly window titles with regular
119
+ expressions special characters in them (Roger Pack)
120
+
121
+
122
+ # 0.0.5 2010-07-07
123
+ * Added method window_area for capturing specified area of the window
124
+ instead of full window (Jarmo Pertman) Usage:
125
+ Win32::Screenshot.window_area(title, x1, y1, x2, y2) {|width, height,
126
+ bmp|}
127
+ * Added method foreground_area for capturing area of the foreground (Jarmo
128
+ Pertman) Usage: Win32::Screenshot.foreground_area(x1, y1, x2, y2) {|width,
129
+ height, bmp|}
130
+ * Added method desktop_area for capturing area of the visible view (Jarmo
131
+ Pertman) Usage: Win32::Screenshot.desktop_area(x1, y1, x2, y2) {|width,
132
+ height, bmp|}
133
+ * Added method hwnd_area for capturing area of the window with specified
134
+ handle (Jarmo Pertman) Usage: Win32::Screenshot.hwnd_area(hwnd, x1, y1,
135
+ x2, y2) {|width, height, bmp|}
136
+
137
+
138
+ ## Internal changes
139
+ * Removed usage of ShowWindow with parameter SW_SHOW when trying to bring
140
+ window to front due it's behaviour of resizing window if it was maximized
141
+ (Jarmo Pertman)
142
+ * Using FFI::Struct when searching window handle (Roger Pack)
143
+
144
+
145
+ # 0.0.4 2010-05-27 - A Complete Overhaul
146
+ * Fixed a bug where taking of screenshots failed on some sizes of windows
147
+ (thanks for the tip from Tony Popiel)
148
+ * Blocks should be used when taking screenshots for cleaning up resources
149
+ after usage (Aslak Hellesøy)
150
+ * Changed library structure - it is now needed to require 'win32/screenshot'
151
+ (Aslak Hellesøy)
152
+ * Replaced Ruby::DL with Ruby-FFI for better VM support and less segfaults
153
+ (Jarmo Pertman)
154
+ * Added Ruby 1.9.1 support (Jarmo Pertman)
155
+ * Win32::Screenshot.window restores window if it's minimized before taking
156
+ screenshots and brings it to the foreground (Jarmo Pertman)
157
+ * Changed some internal method names (Jarmo Pertman)
158
+ * Replaced Test::Unit with RSpec and made specs more robust (Jarmo Pertman)
159
+
160
+
161
+ PS! This version is not backwards compatible due to different method names and
162
+ usage, but upgrading should be relatively easy nevertheless.
163
+
164
+ # 0.0.3 2007-01-18
165
+ * Fixed bug with too many callbacks
166
+ * Added get_hwnd(Regexp)
167
+
168
+
169
+ # 0.0.2 2006-12-02
170
+ * Added desktop method (patch from Ryan Schuft)
171
+ * Added HTTP server example (patch from Ryan Schuft)
172
+ * Added window(regexp) method
173
+
174
+
175
+ # 0.0.1 2006-11-29
176
+ * First release
177
+
data/Gemfile.lock CHANGED
@@ -1,38 +1,45 @@
1
- PATH
2
- remote: .
3
- specs:
4
- win32screenshot (1.0.10)
5
- ffi (~> 1.0)
6
- mini_magick (~> 3.5.0)
7
- rautomation (~> 0.7)
8
-
9
- GEM
10
- remote: https://rubygems.org/
11
- specs:
12
- diff-lcs (1.2.1)
13
- ffi (1.9.0-x86-mingw32)
14
- mini_magick (3.5.0)
15
- subexec (~> 0.2.1)
16
- rake (10.1.0)
17
- rautomation (0.13.0)
18
- ffi
19
- rspec (2.13.0)
20
- rspec-core (~> 2.13.0)
21
- rspec-expectations (~> 2.13.0)
22
- rspec-mocks (~> 2.13.0)
23
- rspec-core (2.13.0)
24
- rspec-expectations (2.13.0)
25
- diff-lcs (>= 1.1.3, < 2.0)
26
- rspec-mocks (2.13.0)
27
- subexec (0.2.3)
28
- yard (0.8.5.2)
29
-
30
- PLATFORMS
31
- ruby
32
- x86-mingw32
33
-
34
- DEPENDENCIES
35
- rake
36
- rspec (~> 2.5)
37
- win32screenshot!
38
- yard
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ win32screenshot (3.1.0)
5
+ ffi (~> 1.15.0)
6
+ mini_magick (~> 4.9)
7
+ rautomation (~> 1.1.0)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ diff-lcs (1.5.0)
13
+ ffi (1.15.5-x86-mingw32)
14
+ mini_magick (4.11.0)
15
+ rake (13.0.6)
16
+ rautomation (1.1.0)
17
+ ffi (~> 1.15.0)
18
+ rspec (3.10.0)
19
+ rspec-core (~> 3.10.0)
20
+ rspec-expectations (~> 3.10.0)
21
+ rspec-mocks (~> 3.10.0)
22
+ rspec-core (3.10.2)
23
+ rspec-support (~> 3.10.0)
24
+ rspec-expectations (3.10.2)
25
+ diff-lcs (>= 1.2.0, < 2.0)
26
+ rspec-support (~> 3.10.0)
27
+ rspec-mocks (3.10.3)
28
+ diff-lcs (>= 1.2.0, < 2.0)
29
+ rspec-support (~> 3.10.0)
30
+ rspec-support (3.10.3)
31
+ webrick (1.7.0)
32
+ yard (0.9.27)
33
+ webrick (~> 1.7.0)
34
+
35
+ PLATFORMS
36
+ x86-mingw32
37
+
38
+ DEPENDENCIES
39
+ rake
40
+ rspec (~> 3.10)
41
+ win32screenshot!
42
+ yard
43
+
44
+ BUNDLED WITH
45
+ 2.3.3
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009-2013 Jarmo Pertman, Aslak Hellesøy
1
+ Copyright (c) Jarmo Pertman, Aslak Hellesøy
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md ADDED
@@ -0,0 +1,48 @@
1
+ # Win32::Screenshot
2
+
3
+ * http://github.com/jarmo/win32screenshot
4
+
5
+
6
+ ## DESCRIPTION
7
+
8
+ Capture Screenshots on Windows with Ruby to bmp, gif, jpg or png formats!
9
+
10
+ ## INSTALL
11
+
12
+ gem install win32screenshot
13
+
14
+ ## SYNOPSIS
15
+
16
+ require 'win32/screenshot'
17
+
18
+ # Take a screenshot of the window with the specified title
19
+ Win32::Screenshot::Take.of(:window, title: "Windows Internet Explorer").write("image.bmp")
20
+
21
+ # Take a screenshot of the foreground
22
+ Win32::Screenshot::Take.of(:foreground).write("image.png")
23
+
24
+ # Take a screenshot of the foreground, and writing over previous image if it exists
25
+ Win32::Screenshot::Take.of(:foreground).write!("image.png")
26
+
27
+ # Take a screenshot of the specified window's top-left corner's area
28
+ Win32::Screenshot::Take.of(:window, title: /internet/i, area: [10, 10, 20, 20]).write("image.jpg")
29
+
30
+ # Take a screenshot of the window with the specified handle
31
+ Win32::Screenshot::Take.of(:window, hwnd: 123456).write("image.gif")
32
+
33
+ # Take a screenshot of the window's client area (e.g. without title bar) with the specified handle
34
+ Win32::Screenshot::Take.of(:window, hwnd: 123456, context: :client)
35
+
36
+ # Take a screenshot of the child window with the specified internal class name
37
+ Win32::Screenshot::Take.of(:rautomation, RAutomation::Window.new(hwnd: 123456).
38
+ child(class: "Internet Explorer_Server")).write("image.png")
39
+
40
+ # Use the bitmap blob for something else
41
+ image = Win32::Screenshot::Take.of(:window, hwnd: 123456)
42
+ image.height # => height of the image
43
+ image.width # => width of the image
44
+ image.bitmap # => bitmap blob
45
+
46
+ ## Copyright
47
+
48
+ Copyright (c) Jarmo Pertman, Aslak Hellesøy. See LICENSE for details.
data/Rakefile CHANGED
@@ -1,4 +1,3 @@
1
- require 'rubygems'
2
1
  require 'bundler'
3
2
  Bundler::GemHelper.install_tasks
4
3
 
@@ -11,6 +10,7 @@ end
11
10
 
12
11
  task :build => :spec
13
12
  task :default => :spec
13
+ task "release:source_control_push" => :spec
14
14
 
15
15
  require 'yard'
16
16
  YARD::Rake::YardocTask.new
@@ -1,101 +1,103 @@
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.
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
+ Terms and Conditions for Use, Reproduction, and Distribution
38
+
39
+ The legally binding and authoritative terms and conditions for use, reproduction, and distribution of ImageMagick follow:
40
+
41
+ Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available.
42
+
43
+ 1. Definitions.
44
+
45
+ License shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
46
+
47
+ Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
48
+
49
+ 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.
50
+
51
+ You (or Your) shall mean an individual or Legal Entity exercising permissions granted by this License.
52
+
53
+ Source form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
54
+
55
+ 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.
56
+
57
+ 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).
58
+
59
+ 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.
60
+
61
+ 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.
62
+
63
+ 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.
64
+
65
+ 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.
66
+
67
+ 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.
68
+
69
+ 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:
70
+
71
+ * You must give any other recipients of the Work or Derivative Works a copy of this License; and
72
+ * You must cause any modified files to carry prominent notices stating that You changed the files; and
73
+ * 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
74
+ * 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.
75
+ 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.
76
+
77
+ 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.
78
+
79
+ 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.
80
+
81
+ 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.
82
+
83
+ 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.
84
+
85
+ 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.
86
+
87
+ How to Apply the License to your Work
88
+
89
+ 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.
90
+
91
+ Copyright [yyyy] [name of copyright owner]
92
+
93
+ Licensed under the ImageMagick License (the "License"); you may not use
94
+ this file except in compliance with the License. You may obtain a copy
95
+ of the License at
96
+
97
+ https://imagemagick.org/script/license.php
98
+
99
+ Unless required by applicable law or agreed to in writing, software
100
+ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
101
+ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
102
+ License for the specific language governing permissions and limitations
103
+ under the License.
@@ -27,6 +27,11 @@ module Win32
27
27
  # @raise [RuntimeError] when _file_path_ is not with the supported output {FORMATS} extension.
28
28
  def write(file_path)
29
29
  raise "File already exists: #{file_path}!" if File.exists? file_path
30
+ write! file_path
31
+ end
32
+
33
+ #Writes image to disk, writing over existing copy if it exists.
34
+ def write!(file_path)
30
35
  ext = File.extname(file_path)[1..-1]
31
36
  raise "File '#{file_path}' has to have one of the following extensions: #{FORMATS.join(", ")}" unless ext && FORMATS.include?(ext.downcase)
32
37
 
@@ -36,7 +41,7 @@ module Win32
36
41
  image = ::MiniMagick::Image.read @bitmap
37
42
  image.format ext
38
43
  image.write file_path
39
- end
44
+ end
40
45
  end
41
46
  end
42
47
  end
@@ -1,5 +1,5 @@
1
- module Win32
2
- module Screenshot
3
- VERSION = "1.0.10"
4
- end
5
- end
1
+ module Win32
2
+ module Screenshot
3
+ VERSION = "3.1.0"
4
+ end
5
+ end