imagecreatefromjpeg problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    imagecreatefromjpeg problem

    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

    #2
    is there any other error ?

    Have you tryed gif ?:confused:
    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...
    _______
    Info & Tips
    php.net
    w3schools.com

    Comment


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

      Comment


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

        Originally posted by ori View Post
        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)
        Last edited by Anshul; 10.04.09, 05:02.

        Comment


          #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
          Code:
          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 ;
               }

          Comment


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

            Comment


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

              Comment


                #8
                Originally posted by ori View Post
                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.

                Comment


                  #9
                  Originally posted by Spook View Post
                  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

                  Comment

                  Working...
                  X