Posted by brianbatesd on May 18, 2010 at 5:58am
6 followers
| Project: | ImageAPI |
| Version: | 6.x-1.8 |
| Component: | ImageAPI GD |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
I set up a content type that has a title, image, and body. The image uploads and displays fine to an anonymous user, but the image preview in the content type creation page gives this error upon upload:
* warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG library reports unrecoverable error: in /home/brianbat/public_html/v2/modules/imageapi/imageapi_gd.module on line 44.
* warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: 'sites/default/files/mega-music-logo.jpg' is not a valid JPEG file in /home/brianbat/public_html/v2/modules/imageapi/imageapi_gd.module on line 44.
* warning: Division by zero in /home/brianbat/public_html/v2/modules/imageapi/imageapi.module on line 222.Any help is appreciated. Thanks.
Comments
#1
I had this problem (at least the division by zero on line 222 of imageapi.module) and it was because I had migrated the site to another server that didn't have php5-gd installed
ubunutu$ sudo apt-get install php5-gd fixed it.
Hope it helps!
Liveoutloud2day
#2
thanks. It works for me too :)
#3
i'm having problems too:
warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG library reports unrecoverable error: in /home/flashmed/public_html/sites/all/modules/imageapi/imageapi_gd.module on line 44.warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: 'sites/default/files/images/jobs/dsc_2875.jpg' is not a valid JPEG file in /home/flashmed/public_html/sites/all/modules/imageapi/imageapi_gd.module on line 44.
warning: Division by zero in /home/flashmed/public_html/sites/all/modules/imageapi/imageapi.module on line 222.
GD installed in the server:
GD Support enabled
GD Version bundled (2.0.34 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.2.1
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XPM Support enabled
XBM Support enabled
module version
6.x-1.10
php.ini
register_globals = Off
memory_limit = 512M
max_execution_time = 300
upload_max_filesize = 64M
uploaded file size: 1.5M
#4
image:
#5
liveoutloud2day's solution (in comment #1) worked for me as well. Thanks!
#6
Well, the solution for me was to use png images, not jpg.
#7
GD is already installed on my system. I transferred my files from development to production environment.
Both the environment are same but somehow uploading image showing an error " warning: Division by zero in /web/thecabin.net/htdocs/sites/all/modules/contrib/imageapi/imageapi.module on line 221."
Please help me in this.
Thanks in advance