features/httpthumbnailer.feature in httpthumbnailer-0.0.13 vs features/httpthumbnailer.feature in httpthumbnailer-0.0.14
- old
+ new
@@ -139,13 +139,24 @@
"""
Then third part will contain JPEG image of size 16x32
And third part mime type will be image/jpeg
And there will be no leaked images
+ Scenario: Handing of large image data - possible thanks to loading size optimization
+ Given test-large.jpg file content as request body
+ When I do PUT request http://localhost:3100/thumbnail/crop,16,16,PNG/crop,32,32,JPEG
+ Then response status will be 200
+ And I will get multipart response
+ Then first part will contain PNG image of size 16x16
+ And first part mime type will be image/png
+ Then second part will contain JPEG image of size 32x32
+ And second part mime type will be image/jpeg
+ And there will be no leaked images
+
Scenario: Memory limits exhausted while loading
Given test-large.jpg file content as request body
- When I do PUT request http://localhost:3100/thumbnail/crop,16,16,PNG
+ When I do PUT request http://localhost:3100/thumbnail/crop,7000,7000,PNG
Then response status will be 413
And response content type will be text/plain
And response body will be CRLF endend lines like
"""
Error: Thumbnailer::ImageTooLargeError: Magick::ImageMagickError: cache resources exhausted
@@ -164,7 +175,41 @@
"""
Error: Thumbnailer::ImageTooLargeError: Magick::ImageMagickError: cache resources exhausted
"""
Then third part will contain JPEG image of size 16x32
And third part mime type will be image/jpeg
+ And there will be no leaked images
+
+ Scenario: Quality option - JPEG
+ Given test.jpg file content as request body
+ When I do PUT request http://localhost:3100/thumbnail/crop,32,32,JPEG,quality:10/crop,32,32,JPG,quality:80/crop,32,32,JPEG,quality:90
+ Then response status will be 200
+ And I will get multipart response
+ And first part mime type will be image/jpeg
+ And second part mime type will be image/jpeg
+ And third part mime type will be image/jpeg
+ Then first part will contain body smaller than second part
+ Then second part will contain body smaller than third part
+
+ Scenario: Quality option - JPEG - default 85
+ Given test.jpg file content as request body
+ When I do PUT request http://localhost:3100/thumbnail/crop,32,32,JPEG,quality:84/crop,32,32,JPG/crop,32,32,JPEG,quality:86
+ Then response status will be 200
+ And I will get multipart response
+ And first part mime type will be image/jpeg
+ And second part mime type will be image/jpeg
+ And third part mime type will be image/jpeg
+ Then first part will contain body smaller than second part
+ Then second part will contain body smaller than third part
+
+ Scenario: Quality option - PNG (XY where X - zlib compresion level, Y - filter)
+ Given test.jpg file content as request body
+ When I do PUT request http://localhost:3100/thumbnail/crop,64,64,PNG,quality:90/crop,64,64,PNG,quality:50/crop,64,64,PNG,quality:10
+ Then response status will be 200
+ And I will get multipart response
+ And first part mime type will be image/png
+ And second part mime type will be image/png
+ And third part mime type will be image/png
+ Then first part will contain body smaller than second part
+ Then second part will contain body smaller than third part
And there will be no leaked images