3

I am using GIMP v.2.8.16 to combine several figures from different file formats into a single JPEG image. I'm able to accomplish this and save as JPEG, and open it on my computer perfectly fine, but when I go to upload it to a website which requires .jpg format files the file is not recognized as a jpeg. I've had this issue multiple times now where the .jpg exported by GIMP is not recognized by other programs.

Just to test that it was related to GIMP, I combined the same figures using LibreOffice Impress and saved as a JPEG, and this file was able to be uploaded with no problems.

Has anyone else experienced this issue and/or come up with a solution?

  • If you can get GIMP to reproducibly create invalid or unrecognized jpg output on a different system, then please use the ubuntu-bug application to file a bug report against the gimp package. Developers cannot fix what they have not been told about. – user535733 Feb 22 '18 at 21:45
  • 4
    Just to clarify, you use Export As, and then choose jpg format down where it says all files? Or do you only change the extention of the file name? – Yuval Harpaz Feb 22 '18 at 22:27
  • 1
    @guiverc Yes I saved the file in .jpeg format, just checked with file image.jpg output was: Figure1_combined.compressed.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, baseline, precision 8, 4450x3087, frames 3 – Reilstein Feb 23 '18 at 2:11
  • 1
    @user535733 I would love to create a bug report, the only problem is that it seems to only be certain websites that don't recognize the file type.... for instance I can open the file/paste the file into microsoft word online. Would it count as reproducible if the website that gives the problem isn't even a high traffic website with strong development? – Reilstein Feb 23 '18 at 2:17
  • 2
    If GIMP is making invalid JPGs, then it's a GIMP bug. If some website fails to recognize valid JPGs, then it's not a GIMP bug. – user535733 Feb 23 '18 at 2:24
2

Background: @karel's answer

reduce the image size to not more than 2.0 MB.

Maybe there is a size limitation on image files on your website. The image that you are uploading to a website is a 4.8 MB .jpg image that is possibly too large for the website that you are uploading it to. Try scaling the image down to reduce its size to something more manageable for the web, not more than 2.0 MB.

Solution that preserves the resolution (and dpi) of the image file

reduce the image size using the 'quality' setting

There is an option in gimp to reduce the 'quality' of a jpeg image. You get a dialogue box, when you try to export the image (as jpeg). Normally I use 'quality=90'.

You can test for example 'quality=70', which reduced the size of a test image from 3.6 MiB to 1.6 MiB. And after that you can fine-tune the 'quality' setting to fit your purpose.

The resolution (pixelwise) remains the same, but the rendering of the colour in adjacent pixels is simlified in a way that reduces the size of the file with the 'least possible loss of quality', when seen by the human eye.

6

The image that you are using worked rendered OK on a demo webpage that I created to test it, so I don't think that there is anything wrong with your image. Maybe there is a size limitation on image files on your website. The image that you are uploading to a website is a 4.8 MB .jpg image that is possibly too large for the website that you are uploading it to. Try scaling the image down to reduce its size to something more manageable for the web, not more than 2.0 MB.

How to resize an image with HTML is for users who want to keep an image at its original file size (in KB or MB) and just resize the display size of the image on a webpage.


I have also found that making any minuscule change to the image in a different application sometimes solves this type of problem.

  1. Open the .jpg file in Image Viewer. Image Viewer is the default application for opening images in Ubuntu.

  2. Select Edit -> Flip Horizontal and flip the image horizontally.

  3. Close the image and when a dialog box will pops up asking if you want to save the changes that you have made to the image, click the Save button.

    IMG:

  4. Repeat steps 1-3 again to flip the image horizontally again so that it looks the same as it was originally.

  • Yeah this didn't work either, although I agree that making tiny changes in other apps usually solves the problem. Here is a link to the figure imgur.com/tbKuFPR . I'm guessing most applications will recognize it, but maybe you have one that will cause an error also that will help diagnose the issue. FYI I'm not super concerned with obtaining the image now as I have already saved it using a different method, but I'm definitely interested in figuring out if this is a GIMP bug because this isn't the first time I've had this type of issue. – Reilstein Feb 23 '18 at 21:01
  • @Reilstein, Did you try to scale the image down to not more than 2 MB? – sudodus Feb 24 '18 at 14:01
  • @sudodus No I did not - and that was on purpose because the submission was to be submitted at 600 dpi. I am not aware of an easy way to scale down the image size so that the image maintains 600dpi resolution but is no larger than 2MB -- do you know of one? – Reilstein Feb 27 '18 at 2:47
  • @Reilstein, There is an option in gimp to reduce the 'quality' of a jpeg image. You get a dialogue box, when you try to export the image (as jpeg). Normally I use 'quality=90'; you can test for example 'quality=70', which reduced the size of a test image from 3.6 MiB to 1.6 MiB. – sudodus Feb 27 '18 at 7:09
  • @Reilstein just don't use jpeg. It's not a very good format to begin with, and is far larger than you need. Use PNG or, for even smaller sizes, convert to a paletted image and save as gif. That said, it sounds like the likeliest problem here is that whatever journal you are submitting to has a limit on maximum file size so this has nothing to do with GIMP creating invalid jpeg files nor, I am afraid, with Ubuntu. Didn't you have any error messages? – terdon Feb 27 '18 at 9:34
-2

Look at the following picture: enter image description here

Use CTRL + E to export. Then change the file extension for other OS.

  • This didn't solve the problem - I was already exporting as a JPEG image. – Reilstein Feb 23 '18 at 2:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.