Gregwar / Image

A PHP library to handle images
MIT License
1k stars 190 forks source link

Image png distort #113

Open thiagopr opened 8 years ago

thiagopr commented 8 years ago

png Image distort after open by fromData method.

use Gregwar\Image\Image; require "vendor/autoload.php";

$content = file_get_contents('image-png.png'); echo '<img src="'.Image::fromData($content)->cacheFile('png').'"><br><br>';

Result: demo

original image: image-png

Thanks!

Gregwar commented 8 years ago

Hello Do you have the sale issue with ::open?

thiagopr commented 8 years ago

Hello, No, with ::open work fine, but i can't use ::open because of the image (content) is stored on database.

-----Mensagem Original----- De: "Grégoire Passault" notifications@github.com Enviada em: ‎30/‎04/‎2016 14:58 Para: "Gregwar/Image" Image@noreply.github.com Cc: "Thiago Oliveira" thiagopr.oliveira@gmail.com; "Author" author@noreply.github.com Assunto: Re: [Gregwar/Image] Image png distort (#113)

Hello Do you have the sale issue with ::open? — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub

LoicLEMEUT commented 6 years ago

Hi all,

Any answer ? method fromData can't support transparent PNG ?

Thanks

LoicLEMEUT commented 6 years ago

When $content is the string (file_get_contents) of my transparent PNG Image:

Don't work: $image = GregwarImage::fromData($content);

This work: $image = GregwarImage::fromResource(imagecreatefromstring(content));