imagecreatefromjpeg problem

Started on the old forum in April 2009 · view the original in the archive · old links redirect here

8 replies · 931 views · started 17 years ago · 1 min read

5 participants
Anshul Senior · 296 posts #1

imagecreatefromjpeg() will give "Warning: imagecreatefromjpeg(): gd-jpeg: JPEG library reports unrecoverable error".

If they are saved in CMYK format (instead of RGB) then GD will fail to load them.

Is there any solution to this problem 🙁

subzero Super moderator Fellow · 3,954 posts #2

is there any other error ?

Have you tryed gif ?😕

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

ori Lead · 512 posts #3

its always worked for me no errors maybe try see if the gd function is up to date

Anshul Senior · 296 posts #4

Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG library reports unrecoverable error: in public_html/photoup.php on line 233

ori wrote: its always worked for me no errors maybe try see if the gd function is up to date

GD Support enabled GD Version bundled (2.0.34 compatible)

rukiya Lead · 569 posts #5

You can not use cmyk format because its a printable format not a browser supportable format. In this case you have to convert the cmyk formate to rgb. you can do it with imagemagick. Here is a function

function cmyk_to_rgb2($c, $m, $y, $k)
     {
    	$c = (255 * $c) / 100;
    	$m = (255 * $m) / 100;
    	$y = (255 * $y) / 100;
    	$k = (255 * $k) / 100;
    	
    	$r = round(((255 - $c) * (255 - $k)) / 255) ;
    	$g = round((255 - $m) * (255 - $k) / 255) ;
    	$b = round((255 - $y) * (255 - $k) / 255) ; 
     
     	$o->r = $r ;
     	$o->g = $g ;
     	$o->b = $b ;
     
     	return $o ;
     }
ori Lead · 512 posts #6

ive seen code like this 2 convert hex to rgb hexdec function does same thing dnt it

ori Lead · 512 posts #7

found it while i was researching some stuff for a image maker i was making

rukiya Lead · 569 posts #8

ori wrote: ive seen code like this 2 convert hex to rgb hexdec function does same thing dnt it

You can use hexdec too but I am telling that you cant use cmyk format for web,cmyk is a printable format, you have to use rgb format. For example if you work with adobe illustrator when you open a print document it will give you a cmyk preview, but if you open a web document it will give you a rgb preview.

GumSlone Administrator Principal · 1,690 posts #9

Spook wrote: imagecreatefromjpeg() will give "Warning: imagecreatefromjpeg(): gd-jpeg: JPEG library reports unrecoverable error".

If they are saved in CMYK format (instead of RGB) then GD will fail to load them.

Is there any solution to this problem :(

can you send me the image to test.

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close