Why is another image generated with a new name?


#1

Hi :smile:

First I want to mention when I upload an image I generate another image.

This new generated image is not being used.

And this is a problem because the new image generated has more weight than the original and this take up the storage space of the server.

For example:

Original Image

  • Name: example.jpg
  • Size : 41.6 KB
  • Dimensions: 1221 x 725

New image generated

  • Name: example_o.jpg
  • Size : 129 KB
  • Dimensions: 1221 x 725

I need someone to explain to me what this is about, or it’s a ghost error.

I’m using the latest version of ghost


Ghost spamming with images
#2

From this line of code it looks like the _o image is the original one and the other one is the image compressed.


#3

There was an issue in pre 2.6.0 versions (https://github.com/TryGhost/Ghost/issues/10144) but that should be fixed now :confused:


#4

@HauntedThemes
@vikaspotluri123

Thank you for answering :smiley:

The original image has the end of _o -> example_o.jpg and the optimized is example.jpg

This also happens when you upload an optimized image, both have the same size.

— But this is still a problem.

I think the non-optimized image should be removed. To have more storage space on our server.


#5

@GodoFredoNinja the original image needs to be kept around so that it’s possible to re-generate compressed/resized images. Storage space should not be much of a concern these days, especially when considering the relatively small size of images.


#6

I don’t agree. The compressed images may be problematic and it’s best practice to keep them.
Actually, the compressed images are bigger in my case. I use JPEGmini which is better at this point.

Just jump in your server to delete them: rm *_o.jpg


#7

Don’t do this! The *_o.jpg images are the originals, if you’re deleting them you risk breaking future functionality where Ghost will generate thumbnail images optimised for different use-cases within a theme.

The best thing to do is leave your images directory alone and let Ghost manage it as needed. If you find particular problems where an optimised image has ended up being larger than the original please raise an issue because that is definitely a bug!


#8

OK good to know :sweat_smile:.


#9

Thank you for taking the time and explaining in the doubt that I had. So, for the moment, I’ll leave things as they are to see what happens in future versions of Ghost. :smile:


#10

If you really don’t want duplicate images or are worried about storage space, you can set the imageOptimization config to have resize set as false

e.g.

{
  "imageOptimization": {
    "resize": false
  }
}

#11

I’m a Ghost Pro user and I don’t have this issue with image file sizes. I was a bug in 2.6 version. I had to reoptimize all my images… but now it works fine. Just checked.


#12

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.