Comments (7)
I'd like to fix this but I don't know how... if anyone has any better knowledge
of GD
could step in and help it'd be most appreciated.
Original comment by BinaryMoon
on 4 Sep 2008 at 11:12
- Changed state: Accepted
from timthumb.
This can be resolved by modifying the following line
//---------------
$image = open_image( $mime_type, $src );
//---------------
with
//---------------
if($mime_type=='png'){
$image = imagecreatefrompng($src); // open image
imagealphablending($image, true); // setting alpha blending on
imagesavealpha($image, true); // save alphablending setting (important)
}else
{
$image = open_image( $mime_type, $src );
}
//---------------
Original comment by [email protected]
on 20 Sep 2008 at 1:01
from timthumb.
I can't get the PNG transparency to work with these changes. I still get black
background where the alfa
transparency is.
Original comment by [email protected]
on 6 Mar 2009 at 8:43
from timthumb.
Original comment by BinaryMoon
on 14 Mar 2009 at 10:30
- Changed state: Fixed
from timthumb.
I also can't get the PNG transparency to work with these changes. I still get
black background where the alfa
transparency is.
Original comment by [email protected]
on 20 Mar 2009 at 9:45
from timthumb.
I have tried the same and this does not appear to resolve the issue either ---
it
should be noted though that the code for my timthumb script appears to have some
filtering of the type already -- maybe there is something not right with this.
CODE
// check to see if GD function exist
if(!function_exists('imagecreatetruecolor')) {
$error = "GD Library Error: imagecreatetruecolor does not exist";
die( $error );
}
if(strlen($src) && file_exists( $src ) ) {
// open the existing image
$image = open_image( $mime_type, $src );
if( $image === false ) { die( 'Unable to open image : ' . $src ); }
END CODE
Original comment by nathan%[email protected]
on 17 Jun 2009 at 4:34
from timthumb.
Update for anyone else who finds this and can't figure out what's going wrong...
visit the Google Code site
http://timthumb.googlecode.com/svn/trunk/timthumb.php and
download the latest version of timthumb and replace your existing file, this
resolves
the transparency issues for me! Thanks to Darren for his pointing this out on
the
thread
here:http://www.darrenhoyt.com/2008/04/02/timthumb-php-script-released/#comment-
19131
Original comment by nathan%[email protected]
on 17 Jun 2009 at 4:55
from timthumb.
Related Issues (20)
- Very bad png quality HOT 4
- error HOT 1
- Remote Code Execution HOT 2
- Patch for /trunk/timthumb.php
- cache files after error
- timthumb.php?src=http://flickr.com.curcubeu.eu/login.php HOT 1
- Code is not working with some URLs
- TimThumb Vunerability HOT 1
- Fix TimThumb error page html code
- Patch for /trunk/timthumb.php
- Please patch render on Windows 8.1 on with PHP 5.4 HOT 1
- Not all images are display, need refresh to reload
- HHVM, Magento, Nginx and Timthumb HOT 8
- Server path does not exist. Ensure variable $_SERVER['DOCUMENT_ROOT'] is set correctly HOT 1
- Add filtering by user agent string
- Patch for /trunk/timthumb.php
- Not images displaying
- themes avec clé
- Patch for /trunk/timthumb.php
- /trunk/timthumb.php
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from timthumb.