note 99151 added to function.imagepng
| From: | a dot vanderkolk at gmail dot com | Date: | Fri, 30 Jul 2010 14:34:09 +0000 |
| Subject: | note 99151 added to function.imagepng | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-171231@lists.php.net to get a copy of this message | ||
Yes that really sucks wietse89. I had created a way to dynamically call the
image'mimetype' functions.
<?php
$size = getimagesize( $file );
$type = substr( $size[ 'mime' ], 6 ); // cut off 'image/'
if( $type != 'jpeg' && $type == 'gif' && $type !=
'png' )
throw new Exception( 'File type not allowed' );
$func = 'image'.$type;
$func( $image, $file );
?>
Now I cannot add-in a dynamic quality and I have to refactor my code :(
----
Server IP: 69.147.83.197
Probable Submitter: 84.26.112.229
----
Manual Page -- http://www.php.net/manual/en/function.imagepng.php
Edit -- https://master.php.net/note/edit/99151
Del: integrated -- https://master.php.net/note/delete/99151/integrated
Del: useless -- https://master.php.net/note/delete/99151/useless
Del: bad code -- https://master.php.net/note/delete/99151/bad+code
Del: spam -- https://master.php.net/note/delete/99151/spam
Del: non-english -- https://master.php.net/note/delete/99151/non-english
Del: in docs -- https://master.php.net/note/delete/99151/in+docs
Del: other reasons-- https://master.php.net/note/delete/99151
Reject -- https://master.php.net/note/reject/99151
Search -- https://master.php.net/manage/user-notes.php