php - sfThumbnailPlugin black background for transparent parts -


i'm using sfthumbnail-plugin (version 2.0.1) in symfony 1.4-project, create thumbnails uploaded pdf-files. unfortunately transparent parts, i.e. background, of documents (which shown white in usual pdf-viewers) converted black in thumbnails.

is there way fix this?

my code:

$t = new sfthumbnail(134, 190, true, true, 75, 'sfimagemagickadapter', array('extract' => 1)); $t->loadfile(sfconfig::get('sf_upload_dir') . "/path/" . $this->getobject()->pdf); $t->save(sfconfig::get('sf_upload_dir') . '/path/' . $this->getobject()->pdf . '.jpg', 'image/jpeg'); 

i cant provide working code this, might consider using pngs, support transparency, suggested here:

imagemagick pdf jpgs results in black background

further can try add flatten option described here:
creating jpg thumbnails pdf causes problems new version of imagemagick

you can pass additional options in 7th param of (untested, thou)

$t = new sfthumbnail(134, 190, true, true, 75, 'sfimagemagickadapter', array('extract' => 1, 'flatten' => true) 

Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -