sfThumbnailPlugin PNG image type resize problem

Ask help about existing plugins, or find advice about the way to build up your own.

sfThumbnailPlugin PNG image type resize problem

Postby chainas » Tue Sep 02, 2008 7:53 pm

Hello,

i use sfThumbnail + sfMediaLibrary plugins to upload and resize images for my website. But i have a big problem, when i try to resize *.png type file with transparent background. Are there any possiblity to make thumbnail transparented too. Because now, all *.png file are made with black or white backgroun.

Thanks
chainas
Senior Member
 
Posts: 146
Joined: Thu Mar 13, 2008 12:49 pm
Location: Lithuania

Re: sfThumbnailPlugin PNG image type resize problem

Postby chainas » Thu May 21, 2009 7:19 pm

Maybe now anybody got solution ?
chainas
Senior Member
 
Posts: 146
Joined: Thu Mar 13, 2008 12:49 pm
Location: Lithuania

Re: sfThumbnailPlugin PNG image type resize problem

Postby joshiausdemwald » Thu May 21, 2009 8:17 pm

sfFilebasePlugin supports resizing transparent images and thumbnail generation.

The thing is done so far, but you'll have to learn it's usage (But it is simple, i promise.) Also shipped with the plugin is a backend module which unfortunately is still in developement, so don't rely on it. But the rather core plugin should fit your needs.

Code: Select all
$f = sfFilebasePlugin::getInstance();
$image = $f['path/to/image.jpg'];
$tn = $image->getThumbnail(array('width'=>100));
...


This is NOT an commercial for the crap i wrote. Ok, perhaps only a little bit ;)~ ;-)~ :wink: I'd love to hear about your experiences if you decide to use it. It's still in beta state so be warned. If you discovered an issue, feel free to tell me so that i can fix it.
Last edited by joshiausdemwald on Thu May 21, 2009 8:19 pm, edited 1 time in total.
joshiausdemwald
Junior Member
 
Posts: 14
Joined: Tue May 12, 2009 10:31 pm
Location: Germany, NRW, near Cologne

Re: sfThumbnailPlugin PNG image type resize problem

Postby chainas » Thu May 21, 2009 8:27 pm

I don't think that it is the best solution. But now i have only this :)~ :-)~ :smile:

It is very strange, that such major bug, is not fixed...
chainas
Senior Member
 
Posts: 146
Joined: Thu Mar 13, 2008 12:49 pm
Location: Lithuania

Re: sfThumbnailPlugin PNG image type resize problem

Postby joshiausdemwald » Thu May 21, 2009 8:46 pm

Ok, i am not supposed to agree with you - but for simple image manipulation stuff the "native" plugin is the best way to do so - so i probably have to. Thus "my" sfFilebasePlugin is intended to do much more, and in a more centralized way - so everything is at one place, not diversed on fileValidators, thumbnail generators and so on... but thats another story, as i mentioned: This is not a commercial^^

I recently saw a ticket about that lack which i think is not a bug but a lack of gd library. Resizing images with transparent backgrounds with gd library isn't that trivial - there are a few workarounds, but beware of the rendering quality.

Resizing by using gdlib + transparency is only possible by using imagecopyresized() wich does not do any subpixel rendering. So your beautiful 32 bit rgb+alpha pngs may look crappy after all.

With image magick it is no problem - "my" plugin does through the imagick extension, the thumbnailPlugin by doing system calls. Don't ask me about which way is better - i simply do not know^^.

I am of the opinion that if you'll use the image magick adapter of the thumbnail plugin, you will get the result you expected.

Greetings,
Joshi
joshiausdemwald
Junior Member
 
Posts: 14
Joined: Tue May 12, 2009 10:31 pm
Location: Germany, NRW, near Cologne

Re: sfThumbnailPlugin PNG image type resize problem

Postby chainas » Thu May 21, 2009 9:17 pm

Huh, i will try to use image magic adapter. But it not helps, i will try Your plugin :)~ :-)~ :smile: It would be very nice to contact You by email. My email: chainas{at}gmail{dot}com
chainas
Senior Member
 
Posts: 146
Joined: Thu Mar 13, 2008 12:49 pm
Location: Lithuania

Re: sfThumbnailPlugin PNG image type resize problem

Postby joshiausdemwald » Fri May 22, 2009 2:12 am

I guess it will work fine if you'd use the imagick adapter. But despite of that, if you really want to give the filebase plugin a try: You are very welcome to contact me by using the mail address published with the plugin: johannes heinen at gmail com.

I'd rather prefer to discuss issues/bug reports and comments on the api in the message board so that potentially interested people can also take a look on it :)~ :-)~ :smile:
joshiausdemwald
Junior Member
 
Posts: 14
Joined: Tue May 12, 2009 10:31 pm
Location: Germany, NRW, near Cologne

Re: sfThumbnailPlugin PNG image type resize problem

Postby shakir33 » Tue Oct 02, 2012 4:15 pm

Hello gays,

here there is a solution for the initial problem with sfThumbnailPlugin.

http://www.codemonkeyjava.com/2011/11/2 ... ailplugin/

i tried it and it work for me ;)
shakir33
Member
 
Posts: 50
Joined: Wed Aug 12, 2009 3:26 pm
Location: casablanca


Return to General plug-ins

Who is online

Users browsing this forum: No registered users and 1 guest

cron