php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61935 When using thumbnailImage(), imagick always creates an after_thumbnail.png
Submitted: 2012-05-04 02:30 UTC Modified: 2012-05-30 20:27 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: abxccd at msn dot com Assigned: mkoppanen (profile)
Status: Closed Package: imagick (PECL)
PHP Version: 5.3.12 OS: Windows 7 64-bit
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: abxccd at msn dot com
New email:
PHP Version: OS:

 

 [2012-05-04 02:30 UTC] abxccd at msn dot com
Description:
------------
I am creating a thumbnail from an image like this:

$file = "D:\files\pictures\mypicture.png"
$img = new Imagick($file)
$img->thumbnailimage(128, 128, TRUE, TRUE); //Resize, best fit and fill
$img->writeImage("D:\files\pictures\thumbs\mypicture.png");
$img->destroy();

While I see a thumbnail created in D:\files\pictures\thumbs\mypicture.png, an extra copy called after_thumbnail.png is also written to my webroot:
D:\files\web\

Expected result:
----------------
The extra after_thumbnail.png should not be written at all.


Patches

imagick_helpers_fix (last revision 2012-05-04 05:34 UTC by abxccd at msn dot com)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-05-04 02:31 UTC] abxccd at msn dot com
Forgot to mention I am testing on 3.1.0RC1.
 [2012-05-04 03:25 UTC] abxccd at msn dot com
This only occurs when "bestFit" is set to true.
 [2012-05-04 05:36 UTC] abxccd at msn dot com
Fixed by removing stray 	

MagickWriteImage(magick_wand, "after_thumbnail.png");

in imagick_helpers.c
 [2012-05-29 13:04 UTC] jobklaassen at hotmail dot com
Looked at the source and fixed the problem. 

In imagick_class.c on line 7825 you will find:
"status = php_imagick_write_file(intern, &file, ImagickWriteImage, adjoin TSRMLS_CC);"

Change to:
"status = php_imagick_write_file(intern, &file, ImagickWriteImages, adjoin TSRMLS_CC);"

Solves this issue.
 [2012-05-30 20:27 UTC] mkoppanen@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: mkoppanen
 [2012-05-30 20:27 UTC] mkoppanen@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

Fixed in 3.1.0RC2
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 06:01:34 2025 UTC