View previous topic :: View next topic |
Author |
Message |
Klian Newbie
Joined: 06 Jan 2007 Posts: 3
|
Posted: Sat Jan 06, 2007 6:22 pm Post subject: Problem with resizing and cropping and PNG |
|
|
Hi,
I have this code:
Code: |
if ($ds->loadImage($img_final)) {
$ds->resizeToSize(125, 0);
$cc->_imgOrig = $ds->_imgFinal;
$cc->cropToSize(CROP_W, CROP_H, ccCENTRE);
$cc->saveImage($img_mini);
$cc->flushImages();
} |
This works fine with JPG and GIF images, but when I try to upload a big PNG it doesnt save the image ($cc->saveImage($img_mini) )
Before adding the resizeToSize function and using only the CropCanvas class , it was working great.
Any help would be appreciated....thanks |
|
Back to top |
|
 |
amnuts Site Admin

Joined: 01 Sep 2002 Posts: 662 Location: East Sussex, England
|
Posted: Sat Jan 06, 2007 8:14 pm Post subject: |
|
|
Hi, and welcome to the board!
What are the sizes of CROP_W and CROP_H? If they are bigger then what your image ends up being then it will product an error. Is '$img_mini' set to a path location and is it writable? Does your GD installation have PNG support?
Try turning on debugging in the classes and see what messages it gives you when trying to process the png file.
Andy |
|
Back to top |
|
 |
Klian Newbie
Joined: 06 Jan 2007 Posts: 3
|
Posted: Sun Jan 07, 2007 6:25 am Post subject: |
|
|
What are the sizes of CROP_W and CROP_H?
125 and 125
If they are bigger then what your image ends up being then it will product an error.
Ok...But Ive deleted that line, and it doesnt work with this code:
Code: | if ($ds->loadImage($img_final)) {
$ds->resizeToSize(125, 0);
$cc->_imgOrig = $ds->_imgFinal;
$cc->saveImage($img_mini);
$cc->flushImages();
} |
Is '$img_mini' set to a path location and is it writable?
Yes, because it works with jpg,gif and small png
Does your GD installation have PNG support?
Yes, because it works with small png
 |
|
Back to top |
|
 |
Klian Newbie
Joined: 06 Jan 2007 Posts: 3
|
Posted: Sun Jan 07, 2007 6:56 am Post subject: |
|
|
I was thinking in your post about the CROP_W and CROP_H, and Ive fixed it with this code
Code: |
if ($ds->loadImage($img_final)) {
$ds->resizeToSize(125, 125);
$cc->_imgOrig = $ds->_imgFinal;
$cc->cropToSize(CROP_W, CROP_H, ccCENTRE);
$cc->saveImage($img_mini);
$cc->flushImages();
}
|
|
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|