asfenwolf.blogg.se

Imagegif quality php
Imagegif quality php










(_please_ specify your OS next time you report a bug): Are you running windows? If so there might be a bug in our windows configuration since afaik these ctx functions should be available when using the bundled libgd. The imagegif() documentation have not been updated (no matter what your mirror thinks) and will not be updated in few days. Null is perfectly acceptable as long as the underlaying libgd supports it and php was compiled correctly. usr/src/php/5.2]$ sapi/cli/php -r '$ret = array() $im = imagecreatetruecolor(1,1) foreach(array("imagegif", "imagewbmp", "imagepng", "imagejpeg") as $func) var_dump($ret) ' The alternative, of course, is to make the php functions more forgiving, but that has always been rejected in the aforementioned bug reports. To back up my assertion that the documentation needs to be specific in this case, look at the number of php bugs reported due to developers thinking the exception thrown by passing null as a second parameter was a mistake in PHP itself. This left me grasping at straws, finally requiring a google search to find out something that should be covered in the documentation. The current documentation (apart from that for imagepng) did not lead me to believe that I was doing anything wrong, and the exception thrown is not clear enough to understand what correction is required. Image_wrapper($type = "gif", $image = null, $filename = null)

#Imagegif quality php code#

(This is a simplified version of the code that prompted this bug report): The following function will cause an exception if no third parameter is specified. I'm unsure if your changes have propagated there as of yet, but the modified date is today. I wrote the following code based on the current documentation on ca.php.net. This ratio is then multiplied by original image height to get the new height. For example, if the original image was 28801800 in size and you want the new image to be 576px wide, the resize ratio would be 576/2880 0.2.

imagegif quality php imagegif quality php imagegif quality php

My test server is set up with PHP 5.1.6 (and perhaps this has become version dependant), and phpinfo reports: This ratio needs to be maintained when calculating the new height of the image. Rpeters+php at icomproductions dot ca Perhaps I'm missing something.










Imagegif quality php