Question regarding image handling

Hi,
I use a self hosted ghost. Now my disc space is grown and I observed that my members use partly very large images >10MB. I also discovered that ghost has two versions of a image saved. Say in directory “myghostdata/images/2021/04” I find

13749995 Apr 17  2021 DSC_9987_o.JPG
  884626 Apr 17  2021 DSC_9989.JPG

Stands the _o image for “original image” and would it be save to remove all _o-images and only keep the none-o-images?
Or is it better to process all the “o-images” with a resize-tool and make them smaller?

Another question is: Is there a way to restrict the images size on a maximum size when the blog entry is created?

Best regards
Thomas

The file example above is confusing. o-file and non-o-file for the same picture.
This is better:

-rw-r--r-- 1 doctor-bee doctor-bee   414966 Apr 17  2021 DSC_9987.JPG
-rw-r--r-- 1 doctor-bee doctor-bee 13749995 Apr 17  2021 DSC_9987_o.JPG

Question: Is it save to decrease the size of the o-file to save disk space?
Has ghost a mechanism to limit the file size for images on upload?

Thanks
Thomas

The _o file is the original file, exactly as it was uploaded. It’s used as the basis for generating any of the resized versions that are requested to avoid quality problems from repeated optimisation.

The initially resized image is the smaller one you see alongside the _o version. That’s been resized to have a max width of 2000px and is the default image displayed to your site visitors.

Other sizes of images are generated on first request and are located in myghostdata/images/sizes/*. Those sizes come from the responsive image markup generated for images within content and for any thumbnails etc that your theme uses.

All resizing is done to improve loading time and data usage for your visitors. Disk space usage is not a driving concern.

would it be save to remove all _o -images and only keep the none-o-images?

No, that would break the on-request image resizing.

Or is it better to process all the “o-images” with a resize-tool and make them smaller?

You can certainly do that if it’s a concern.

Is there a way to restrict the images size on a maximum size when the blog entry is created?

There’s nothing built-in. It could be possible using a custom storage adapter

What size would you recommend for a scaled down original image?

If you’re trying maximize disk space, I’d do a max-width of 2000px, with the recognition that your Ghost site won’t be able to serve any image larger than that. I’d also begin by only resizing a handful of images to see if the results are acceptable.

1 Like