khashnan / timthumb

Automatically exported from code.google.com/p/timthumb
0 stars 0 forks source link

White Background for zc=2 #183

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Is there any way to get a white background instead of a black background when 
the Zoom/Crop setting is set to 2?

I've tried changing the imagecolorallocatealpha() values, but that didn't help, 
so I guess I'm looking in the wrong place.

Original issue reported on code.google.com by marc.per...@gmail.com on 28 Apr 2011 at 11:43

GoogleCodeExporter commented 8 years ago
To overcome this, I implemented temporary hack.  Around line 143:

// Create a new transparent color for image
// $color = imagecolorallocatealpha ($canvas, 0, 0, 0, 127); // old black 
background
$color = imagecolorallocate ($canvas, 255, 255, 255); // Fill with white.

This may not work for everyone, but it works in my scenario for the time being.
Thanks,
William

Original comment by wp.came...@gmail.com on 24 May 2011 at 10:26

GoogleCodeExporter commented 8 years ago
Works for me! :-)

Original comment by lme...@gmail.com on 20 Jun 2011 at 7:26

GoogleCodeExporter commented 8 years ago
I think a more ideal solution would be to switch to the imagecolorallocate for 
the jpg processing, because the png processing works as it should (I believe, 
didn't test the transparency or if it just uses white). But I did notice the 
black background for jpg images and the above fixed it.

Original comment by toltma...@gmail.com on 8 Jul 2011 at 10:10

GoogleCodeExporter commented 8 years ago
I have changed the default to white, and have added a new parameter to allow 
you to specify the background colour (cc=000000 = black)

Original comment by BinaryMoon on 17 Jul 2011 at 7:56

GoogleCodeExporter commented 8 years ago
A mi también me funciono, hablo de esto:

/ / Crear un nuevo color transparente para una imagen
/ / $ Color = imagecolorallocatealpha ($canvas, 0, 0, 0, 127) / / viejo fondo 
negro
$ Color = imagecolorallocate ($canvas, 255, 255, 255) / / Rellenar con blanco.

Original comment by camiloca...@gmail.com on 11 Jun 2013 at 6:38

GoogleCodeExporter commented 8 years ago
For some reason, I have the CC set to ffffff, and I still get the Black 
Background!

Original comment by men...@gmail.com on 12 Jul 2013 at 3:10