google-code-export / appengine-jruby

Automatically exported from code.google.com/p/appengine-jruby
0 stars 0 forks source link

Image.resize(100, 0) should calculate the second value #82

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. get an image
2. call resize(100, 0) (or resize(0, 100)) on it

What is the expected output? What do you see instead?

Resized image to width, or height with the zero value filled in.

What version of the product are you using? On what operating system?

appengine-apis (0.0.16, 0.0.15)
appengine-jruby-jars (0.0.7, 0.0.7.pre, 0.0.6)
appengine-rack (0.0.9, 0.0.8, 0.0.7)
appengine-sdk (1.3.4, 1.3.3.1, 1.3.2)
appengine-tools (0.0.13, 0.0.12, 0.0.11)
google-appengine (0.0.13, 0.0.12, 0.0.11)

Ubuntu

Please provide any additional information below.

The resize(w, h) method does not accept zeros or nils for auto calculated 
size. It would save some time for developeres if it would.

Original issue reported on code.google.com by michal.h...@gmail.com on 7 Jun 2010 at 12:45

GoogleCodeExporter commented 9 years ago
Note: according to GAE Java APIs, the resize method does not raise exception 
when 
passed (100, 0), so it might as well auto-calculcate the other value.

http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/imag
es/Ima
gesServiceFactory.html#makeResize(int, int)

Not sure if it does though, but it makes more sense (i think) to calculate the 
other 
value than to return zero sized image or raise an exception.

Original comment by michal.h...@gmail.com on 7 Jun 2010 at 12:52