README.md in httpthumbnailer-client-1.2.0 vs README.md in httpthumbnailer-client-1.3.0
- old
+ new
@@ -1,9 +1,16 @@
# HTTP Thubnailer Client
-Ruby client to [httpthumbnailer](http://github.com/jpastuszek/httpthumbnailer) image scaling and conversion HTTP API server.
+Ruby client to [httpthumbnailer](http://github.com/jpastuszek/httpthumbnailer) image thumbnailing, editing and format conversion HTTP API server.
+## Changelog
+
+### 1.3.0
+* added edits support
+* better spec parsing and error handling
+* using single thumbnail API if only one thumbnail spec defined
+
## Installing
```bash
gem install httpthumbnailer-client
```
@@ -28,11 +35,11 @@
thumbnail.height # => 30
thumbnail.data # => 60x30 thumbnail JPEG data String
# generate set of thumbnails from image data (multipart API)
thumbnails = HTTPThumbnailerClient.new('http://localhost:3100').thumbnail(data) do
- thumbnail 'crop', 60, 30, 'jpeg'
+ thumbnail 'crop', 60, 30, 'jpeg'
thumbnail 'crop', 80, 80, 'png'
thumbnail 'pad', 40, 40, 'png'
end
thumbnails[0].mime_type # => 'image/jpeg'
@@ -63,13 +70,32 @@
# pass transaction ID header to thumbnailer
id = HTTPThumbnailerClient.new('http://localhost:3100').with_headers('XID' => '123').identify(data)
id.mime_type # => 'image/jpeg'
id.width # => 800
id.height # => 600
+
+# generate single thumbnail from image data with additional edits
+thumbnail = HTTPThumbnailerClient.new('http://localhost:3100').thumbnail(data, 'crop', 60, 30, 'jpeg') do
+ edit 'rotate', 90
+ edit 'pixelate', 0.3, 0.2, 0.4, 0.4
+end
+
+# generate set of thumbnails from image data with additional edits
+thumbnails = HTTPThumbnailerClient.new('http://localhost:3100').thumbnail(data) do
+ thumbnail 'crop', 60, 30, 'jpeg' do
+ edit 'rotate', 90
+ end
+ thumbnail 'crop', 80, 80, 'png' do
+ edit 'rotate', 270
+ edit 'pixelate', 0.3, 0.2, 0.4, 0.4
+ end
+ thumbnail 'pad', 40, 40, 'png'
+end
```
For more details see RSpec for [single thumbnail API](http://github.com/jpastuszek/httpthumbnailer-client/blob/master/spec/thumbnail_spec.rb) and [multipart API](http://github.com/jpastuszek/httpthumbnailer-client/blob/master/spec/thumbnails_spec.rb).
+Note that when providing only one thumbnail specification using multipart API style the client will actually use single thumbnail API instead.
### CLI tool
This gem provides `httpthumbnailer-client` command line tool that can be used to thumbnail images via [httpthumbnailer](http://github.com/jpastuszek/httpthumbnailer).
@@ -83,22 +109,24 @@
# thumbnail to standard output
cat image.jpg | httpthumbnailer-client -t crop,100,200,png > thumbnail.png
# generate multiple thumbnails
cat image.jpg | httpthumbnailer-client -t crop,100,200,jpeg,quality:100 -t pad,200,200,png thumbnail1.jpg thumbnail2.png
+
+# generate thumbnail with edits
+cat image.jpg | httpthumbnailer-client -t 'fit,280,280,png!pixelate,0.3,0.2,0.4,0.4!rectangle,0.04,0.8,0.92,0.17,color:blue' > thumbnail.png
```
## Contributing to HTTP Thubnailer Client
-
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
* Fork the project
* Start a feature/bugfix branch
* Commit and push until you are happy with your contribution
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
## Copyright
-Copyright (c) 2013 Jakub Pastuszek. See LICENSE.txt for
-further details.
+Copyright (c) 2013 - 2015 Jakub Pastuszek. See LICENSE.txt for further details.