Pete Posted December 27, 2011 Share Posted December 27, 2011 Hi I think there might be a problem when showing thumbnails in the page editor if they have transparent backgrounds (see attached image). Basically when an image is resized I don't think it's storing the transparency data. It's been a while since I looked at thumbnailing in PHP and I think you can save that data when thumbnailing gifs, but an easy solution here would be to set the canvas background to be white instead of black (which I seem to recall is the default) since the page background is normally white in the PW backend. Obviously saving the transparency would be the favourite solution as I know we have one dark admin theme already. Possible solution here: http://www.php.net/manual/en/function.imagecopyresized.php#104556 Not sure if there would be similar issues with PNGs? Link to comment Share on other sites More sharing options...
ryan Posted December 27, 2011 Share Posted December 27, 2011 Thanks Pete, I'll take a look at this and should be able to change the BG color. PNGs should be okay, as I think we've fixed something similar with PNGs in the past. GIFs are generally terrible for any kind of resize and I'd recommend avoiding them in any situations where you need to be creating size or crop variations. But I know it's not always a choice. Hopefully we can get the transparency working with them. Link to comment Share on other sites More sharing options...
Pete Posted December 27, 2011 Author Share Posted December 27, 2011 No worries - to be honest I didn't even realise it was a GIF until I uploaded it and I'll probably just convert it to a PNG anyway. I think in my code in the past to get around potential headaches with grainy thumbnailed GIFs I saved them as JPEGs instead to get better compression, but that's not always going to be the desired way to do it. Link to comment Share on other sites More sharing options...
Soma Posted December 27, 2011 Share Posted December 27, 2011 OT: Oh cool, another one using my teflon theme. ;D I just sense you need to update , you're using not the latest one. Link to comment Share on other sites More sharing options...
john Posted September 20, 2012 Share Posted September 20, 2012 I added a few lines to the imageSizer based on code linked to above and tested with regular and transparent GIF and PNG images. Not sure how to submit it. I committed the changes on github and made a pull request. Hopefully this will be added. I don't think it's reasonable to require users to convert GIF to PNG before uploading. 1 Link to comment Share on other sites More sharing options...
ryan Posted September 20, 2012 Share Posted September 20, 2012 Thanks for the pull request John. I will bring this in soon. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now