Is there any way I can serve scaled images in Ghost?

Hi,

I see that image optimization is present in the Ghost but is there any way we can serve scaled images for the sizes we’ve mentioned in the themes? Event we want to show a 64 x 64px image, Ghost loads the full image (may be 800 x 600).

If this feature isn’t available till now, is there any alternative ways we can apply to a Ghost theme?

Thank you. :slight_smile:

1 Like

There is! Check out the Cloudinary integration :) it’s a premium svc but they have a pretty generous free tier:

https://docs.ghost.org/integrations/cloudinary/

2 Likes

Thank you very much for the tip!
I was able to get 100 score on google PageSpeed insights with this trick. :star_struck:

3 Likes

NICE, great work!

1 Like

Amazing! Now I just wonder what other integrations out there I’m missing.

If you are on a tight budget, you can rescale and optimize your images locally. We use this (older) recommendation by Google to optimize our images using ImageMagick’s convert utility: 画像を最適化する  |  PageSpeed Insights  |  Google Developers

For JPEGs it gives the following example which is perfect for our use site:
convert puzzle.jpg -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace sRGB puzzle_converted.jpg

We use this in a cron job running every few minutes on the new image files.

If you know that you always need the images in 64x64 pixels you can first scale them with convert, too. This way we produce different sizes of the same image in separate directories, which are size-optimised for e.g. Facebook.

The newer recommendations of Google can be found here and include local solutions as well as services such as Cloudinary: web.dev

1 Like

Yeah, You’re right. We have to pay for the Bandwidth, storage and processing power separately in Cloudinary. (BTW, it worths it)

I was considering about installing Thumbor on the same server where we host Ghost.

If we can map the Ghost local image directory into Thumbor, we will be able to get the same functionality where we get from Cloudinary.

At the moment I’m afraid of doing such operation in the live server (I only have one :wink:). So I’ll try it in near future.

If anyone has been doing the same earlier, hereby I’d like to kindly ask them to share the knowledge.

Thank you for the suggestion. :slight_smile:

1 Like

Thanks for suggesting Thumbor. This looks like a very nice tool, indeed! Maybe we will give it a try in our next project.

1 Like

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