Bug with imglib |
|||
|---|---|---|---|
| Date: | 07/19/2008 | Severity: | Minor |
| Status: | Resolved | Reporter: | Bramme |
| Version: | 1.6.3 | ||
| Keywords: | Libraries, Image Manipulation Class | ||
Description
I’m using the imglib for a portfolio backend. Images have to be 450px wide, they get resized if they’re too big or enlarged when too small. When the resize is made, a thumbnail is copied from it and the first one is watermarked.
When uploading a new batch pictures that I had resized before uploading, the whole process failed because the first resize threw an error. I suppose the error was caused because the image had the same size as the “resize to” size.
Is this intentional, because I would think it’d be more logical to just make a copy then and pretend there’s nothing wrong.
Expected Result
Actual Result
Comment on Bug Report
| Posted by: Bramme on 19 July 2008 6:09am | |
|
|
sorry, this isn’t in the svn but in version 1.6.3, forgot to change that. |
| Posted by: Derek Allard on 19 July 2008 8:10am | |
|
|
OK Bramme, so I know something went wrong for you, but what is the bug you are reporting? (I’ve changed the version to 1.6.3 for you). |
| Posted by: Bramme on 20 July 2008 5:36am | |
|
|
function process_uploaded_image($filename){Where you see “error at first resize” the script throws an error “The image copy routine failed.”. Though the image is correctly copied, the script throws this error, presumably because the original image width was equal to the width it had to be resized to. Though because the imglib returns false here (because of the error) the rest of my method fails, while actually it should continue: the image I wanted was correctly copied, even if it wasn’t technically resized. I think the imglib should pretend like there’s nothing wrong and return true when it just copies the original image. |
| Posted by: onejaguar on 24 September 2008 4:37pm | |
|
|
I think there is problem in the library if you have not specified a new_image. The default value of new_image is ‘’. This line is used to see if a resize is necessary:
if (($this->orig_width == $this->width AND $this->orig_height == $this->height) AND ($this->source_image != $this->new_image))
And since source_image != ‘’ it tries to copy source image to a file named ‘’ which of course is not possible. The library code should probably be changed to:
if ($this->orig_width == $this->width AND $this->orig_height == $this->height) |
