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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Can't resize png files


Go to End


5 Posts   928 Views

Avatar
Rodskagg

Community Member, 26 Posts

4 April 2015 at 1:54am

When uploading a png file the thumbnail image renders as a broken image. If I past the URL to the thumbnail into a new browser tab, I get an error saying "You don't have permission to access [URL of file]". The resized image is missing from the _resampled and when I check the console logs I see "client denied by server configuration".

This only happens with png files. Jpg files are resized as intended.

Is this a configuration problem or a bug?

Avatar
Pyromanik

Community Member, 419 Posts

7 April 2015 at 11:14pm

Edited: 07/04/2015 11:14pm

Configuration.
Assuming you're probably not using Apache, you need to allow .png files from the assets folder, and that the web user (whoever runs the PHP script) has permission to write to that (and all sub-)folder(s).

If you're familiar with Apache configs you can look at the assets/.htaccess to see how it does things.

Avatar
Rodskagg

Community Member, 26 Posts

7 April 2015 at 11:42pm

I am using Apache, and there's nothing wrong with the permission settings or the .htaccess file for the assets folder and it's subfolders.

However, I noticed that I only have this problem on my local development machine. Seems to work fine in the production environment, so it seems like this is a configuration problem.

Avatar
Devlin

Community Member, 344 Posts

8 April 2015 at 8:07pm

Are you running OSX Yosemite on your machine? Because Apple forgot to include imagecreatefrompng().

Avatar
Rodskagg

Community Member, 26 Posts

8 April 2015 at 8:42pm

I am running Yosemite. That explains it!