Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

How to deliver .png files as .jpg?


Go to End


1047 Views

Avatar
MarioSommereder

Community Member, 107 Posts

8 March 2013 at 12:26am

Hello everyone,

I want to organise my files inside the backend as lossless .png files, but I want the CMS to deliver them as compressed .jpg files. That way I must not keep the .png files somewhere else, just to make sure I have the best quality images ready to use again.

What's the best way to setup this?

Does it make sense to add an extension to the Image object using the GD lib? And is it possible to find out if a .png file uses alpha and - because of that - has to be delivered as .png and not as .jpg?

Thanks for any help.

Cheers, Mario