Hi,
Using Fabrik 1.0.5
I was receiving an error on a form I had created to upload images. On the element setup, I omitted a width on the image size field because I wanted the image to keep it's aspect ratio instead of forcing a width that makes the image look too fat or too thin.
So, when Fabrik looks for the $maxWidth property, it is never set. That gave me this error:
-------------------------------------------------------
Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in C:\wamp\www\fabrik\components\com_fabrik\fabrik.class.php on line 3551
Warning: imagecopyresampled(): supplied argument is not a valid Image resource in C:\wamp\www\fabrik\components\com_fabrik\fabrik.class.php on line 3554
no image created for C:\wamp\www\fabrik\flash\biglogos\103_1109_JPG.jpg, extension = jpg
-------------------------------------------------------
I went in to the fabrik.class.php file to the lines specified and added the following to line 3541:
-------------------------------------------------------
if($maxWidth < 20){
$maxWidth = round((($maxHeight * $width) / $height));
}
-------------------------------------------------------
This locks in the correct aspect ratio for the $maxWidth when $maxHeight is set in the element setup. (I set it to see if it's less than 20, just a random number I picked to make sure the width isn't set correctly...probably could be 1)
Of course, this is specific to my problem. If you don't set a $maxHeight in the element setup, this won't work. More tweaking is necessary to check that and to assign resizing variables appropriately.
I hope this helps anybody that has experienced this. As always, any pointers on something I could have done differently are welcome.
Cheers!
Using Fabrik 1.0.5
I was receiving an error on a form I had created to upload images. On the element setup, I omitted a width on the image size field because I wanted the image to keep it's aspect ratio instead of forcing a width that makes the image look too fat or too thin.
So, when Fabrik looks for the $maxWidth property, it is never set. That gave me this error:
-------------------------------------------------------
Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in C:\wamp\www\fabrik\components\com_fabrik\fabrik.class.php on line 3551
Warning: imagecopyresampled(): supplied argument is not a valid Image resource in C:\wamp\www\fabrik\components\com_fabrik\fabrik.class.php on line 3554
no image created for C:\wamp\www\fabrik\flash\biglogos\103_1109_JPG.jpg, extension = jpg
-------------------------------------------------------
I went in to the fabrik.class.php file to the lines specified and added the following to line 3541:
-------------------------------------------------------
if($maxWidth < 20){
$maxWidth = round((($maxHeight * $width) / $height));
}
-------------------------------------------------------
This locks in the correct aspect ratio for the $maxWidth when $maxHeight is set in the element setup. (I set it to see if it's less than 20, just a random number I picked to make sure the width isn't set correctly...probably could be 1)
Of course, this is specific to my problem. If you don't set a $maxHeight in the element setup, this won't work. More tweaking is necessary to check that and to assign resizing variables appropriately.
I hope this helps anybody that has experienced this. As always, any pointers on something I could have done differently are welcome.
Cheers!