Menu

Problems with jpg images

Help
Thorsten
2006-09-14
2013-04-25
  • Thorsten

    Thorsten - 2006-09-14

    Hello,

    I'm trying to embed a jpg image into a pdf and get the error 1039. I tried to save the file with different jpg options (baseline, progressive etc.), in different resolutions and also with different programs, but always get the same error. Embedding one of the images from the examples in the documentation works, however. Has anyone had the same problem? Any help would be highly appreciated!

     
    • takeshi kanno

      takeshi kanno - 2006-09-15

      Hi,

      the error 1039 is HPDF_INVALID_PARAMETER.
      This error is not related to JPEG image.

      I think that an invalid parameter is specified in the function somewhere.

      Post your code.
      I will confirm it.

      Regards,

       
    • Thorsten

      Thorsten - 2006-09-15

      Hi,

      thanks for the quick answer. Unfortunately I'm not at work at the moment so I don't have access to the code. The line where the program crashes is:

      image = HPDF_LoadJpegImageFromFile(pdf, "c:\\<some dir>\\<image name>.jpg");

      where image is of type HPDF_Image. When I put one of your examples in <some dir> and use it, everything is fine (tried rgb.jpg). Also, changing <image name> to a non existent file gives a different error than 1039 (I think it was 1017), so the filename seems not to be the problem. If necessary I can send you a code snippet the next time I'm working on this project.

      Regards,

       
    • Anonymous

      Anonymous - 2006-10-23

      Hello,

      still having problems with embedding jpg-files in Windows XP! As said, I can use the jpg-files included in the html documentation of the library perfectly. Using own images fails, however (The error code is 1039 with detail_no = 0). In my previous post I forgot to say that the vaariable "pdf" is of type HPDF_Doc. Is there a jpg option (baseline, progressive, embedded color profile etc.) which can't be used together with the haru pdf library?

       
      • takeshi kanno

        takeshi kanno - 2006-10-23

        > Is there a jpg option (baseline, progressive, embedded color profile etc.) which can't be used together with the haru pdf library?

        libharu can load the following JPEG image.
        8bit GrayScale
        24bit RGB Color
        32bit CMYK Color

        The images which have other color format can not be used.
        Though I have not tried, maybe embedded color profile image cannot be used.

         
    • Anonymous

      Anonymous - 2006-10-23

      Now it works. Don't ask, why. Is it possible that there are restrictions concerning the image dimensions?

       

Log in to post a comment.

MongoDB Logo MongoDB