7913 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » [Warning] imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
| Go to End | Next > | |
| Author | Topic: | 9156 Views |
-
[Warning] imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions

7 July 2009 at 2:09am
Hey! good morning everybody!
I have been installed the image_gallery module, but i have a problem. In the section admin everything is fine, but in the public site, when i try to get into gallery page, i get this error:
[Warning] imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions
GET /galerias/?flush=1Line 64 in /var/www/vhosts/mysite.com/httpdocs/sapphire/filesystem/GD.php
Source55 /**
56 * Resize an image to cover the given width/height completely, and crop off any overhanging edges.
57 */
58 function croppedResize($width, $height) {
59 if(!$this->gd) return;
60
61 $width = round($width);
62 $height = round($height);
63
64 $newGD = imagecreatetruecolor($width, $height);
65
66 // Preserves transparency between images
67 imagealphablending($newGD, false);
68 imagesavealpha($newGD, true);
69
70 $destAR = $width / $height;Anybody know what is the problem? Thanks!
-
Re: [Warning] imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions

7 July 2009 at 2:33am
Make sure you have all the dimensions set in your ImageGalleryPage Configuration tab.
-
Re: [Warning] imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions

7 July 2009 at 2:43am
Perfect!
That was the solution!
Thank you so much!
-
Re: [Warning] imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions

20 August 2009 at 6:25am
I've had this problem, shouldn't this be validated on the form either frontend or backend to make it impossible for people to make mistakes. Lots of silverstripe projects customers have access to CMS so it is definitely a risk that they change the form and then it corrupts on the frontend of the site without them realising what they have done. I thought that I could just set one setting for the thumbnail and the other side would be worked out depeding on what the ratio of the photo size was.
This should ideally be set as standard, validation so that either neither height or width is set or that both are set.
Otherwise really great module and really impressed by what you have accomplished.
Cheers
Will
-
Re: [Warning] imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions

20 August 2009 at 6:44am
I've since patched this bug so that 0 is never an accepted value for image size.
-
Re: [Warning] imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions

18 March 2010 at 12:47am Last edited: 18 March 2010 1:02am
Hi UncleCheese,
I am getting this strange error for Image:[Warning] imagejpeg() [function.imagejpeg]: Unable to open '../assets/Uploads/_resampled/CMSThumbnail-Building-HP-4.jpg' for writing
GET /images/iframe/HomepageSliderSlide/113/PhotoLine 397 in /var/www/vhosts/friendsofpubliced.org/httpdocs/sapphire/filesystem/GD.php
Source388 case "gif": $type = 1; break;
389 case "jpeg": case "jpg": case "jpe": $type = 2; break;
390 default: $type = 3; break;
391 }
392
393 // if the extension does not exist, the file will not be created!
394
395 switch($type) {
396 case 1: imagegif($this->gd, $filename); break;
397 case 2: imagejpeg($this->gd, $filename, $this->quality); break;Can you give me suggesstion how this error is rectified.
I increased the memory size to 128MB using this code "ini_set('memory_limit', '128M');" in mysite/_config.php file.
But It is not giving the solution for this error.I am not getting this error in my localhost with the same server copy. This error is coming in Production server only.
-
Re: [Warning] imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions

18 March 2010 at 2:36am
Can you give me some context? Is this the ImageGallery module? What are you trying to do?
-
Re: [Warning] imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions

18 March 2010 at 6:03am
It is coming in ImageGallery module, for "cover Image " under Albums tab.
This same error also coming in another Page used for Homepage slide shows .
class HomepageSlider extends Page {
static $defaults = array(
'HideInSitemap' => '1',
'ShowInMenus' =>'0',
);
static $allowed_children = array(
'HomepageSliderSlide'
);and
class HomepageSliderSlide extends Page {
static $defaults = array(
'HideInSitemap' => '1',
'ShowInMenus' =>'0',
);
static $db = array();
static $has_one = array(
'Photo' => 'Image'
);
| 9156 Views | ||
| Go to Top | Next > |

