<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: Generating JPG/GIF/PNG thumbnails in PHP using imagegif, imagejpeg, imagepng</title> <atom:link href="http://sniptools.com/vault/generating-jpggifpng-thumbnails-in-php-using-imagegif-imagejpeg-imagepng/feed" rel="self" type="application/rss+xml" /><link>http://sniptools.com/vault/generating-jpggifpng-thumbnails-in-php-using-imagegif-imagejpeg-imagepng</link> <description>Design &#38; Technology Observations</description> <lastBuildDate>Wed, 09 May 2012 20:59:10 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /> <item><title>By: karthi</title><link>http://sniptools.com/vault/generating-jpggifpng-thumbnails-in-php-using-imagegif-imagejpeg-imagepng#comment-2624</link> <dc:creator>karthi</dc:creator> <pubDate>Thu, 28 Apr 2011 12:53:46 +0000</pubDate> <guid
isPermaLink="false">http://sniptools.com/cms/?p=40#comment-2624</guid> <description>Hello with latest PHP you can also use this$ffmpeg = &quot;ffmpeg Installed path&quot;
$flvfile = &quot;source video file with root path&quot;
$png_path &quot; &quot;Destination video file with root path and file type&quot;
exec(&quot;$ffmpeg -y -i $flvfile -vframes 1 -ss 00:01:60 -an -vcodec png -f rawvideo -s 110x90 $png_path&quot;);</description> <content:encoded><![CDATA[<p>Hello with latest PHP you can also use this</p><p>$ffmpeg = "ffmpeg Installed path"<br
/> $flvfile = "source video file with root path"<br
/> $png_path " "Destination video file with root path and file type"<br
/> exec("$ffmpeg –y –i $flvfile –vframes 1 –ss 00:01:60 –an –vcodec png –f rawvideo –s 110x90 $png_path");</p> ]]></content:encoded> </item> <item><title>By: PHP Thumbnail Generator &#124; Danny Kopping &#124; RIA-CODER.COM</title><link>http://sniptools.com/vault/generating-jpggifpng-thumbnails-in-php-using-imagegif-imagejpeg-imagepng#comment-2453</link> <dc:creator>PHP Thumbnail Generator &#124; Danny Kopping &#124; RIA-CODER.COM</dc:creator> <pubDate>Tue, 06 Oct 2009 11:58:09 +0000</pubDate> <guid
isPermaLink="false">http://sniptools.com/cms/?p=40#comment-2453</guid> <description>[...] credit goes toÂ http://sniptools.com/vault/generating-jpggifpng-thumbnails-in-php-using-imagegif-imagejpeg-imagepng for the snippet!   Share this [...]</description> <content:encoded><![CDATA[<p>[…] credit goes toÂ http://sniptools.com/vault/generating-jpggifpng-thumbnails-in-php-using-imagegif-imagejpeg-imagepng for the snippet!   Share this […]</p> ]]></content:encoded> </item> <item><title>By: Ben</title><link>http://sniptools.com/vault/generating-jpggifpng-thumbnails-in-php-using-imagegif-imagejpeg-imagepng#comment-2406</link> <dc:creator>Ben</dc:creator> <pubDate>Wed, 15 Apr 2009 23:37:20 +0000</pubDate> <guid
isPermaLink="false">http://sniptools.com/cms/?p=40#comment-2406</guid> <description>I also suffer from the black line blues....  I believe it only occurs with space outside of the range of the actual desired image dimensions when dealing with cropping, yet I can&#039;t seem to figure out how to fix it yet.</description> <content:encoded><![CDATA[<p>I also suffer from the black line blues.…  I believe it only occurs with space outside of the range of the actual desired image dimensions when dealing with cropping, yet I can't seem to figure out how to fix it yet.</p> ]]></content:encoded> </item> <item><title>By: michael</title><link>http://sniptools.com/vault/generating-jpggifpng-thumbnails-in-php-using-imagegif-imagejpeg-imagepng#comment-2399</link> <dc:creator>michael</dc:creator> <pubDate>Mon, 06 Apr 2009 22:42:40 +0000</pubDate> <guid
isPermaLink="false">http://sniptools.com/cms/?p=40#comment-2399</guid> <description>check out this one
http://freelogic.pl/thumbnailer/</description> <content:encoded><![CDATA[<p>check out this one<br
/> <a
href="http://freelogic.pl/thumbnailer/" rel="nofollow">http://freelogic.pl/thumbnailer/</a></p> ]]></content:encoded> </item> <item><title>By: sharifbaba</title><link>http://sniptools.com/vault/generating-jpggifpng-thumbnails-in-php-using-imagegif-imagejpeg-imagepng#comment-2338</link> <dc:creator>sharifbaba</dc:creator> <pubDate>Mon, 15 Sep 2008 19:35:24 +0000</pubDate> <guid
isPermaLink="false">http://sniptools.com/cms/?p=40#comment-2338</guid> <description>hi
is there any way  that i can create gif animated image from jpeg ,
image as background and gif image on top of it ...</description> <content:encoded><![CDATA[<p>hi<br
/> is there any way  that i can create gif animated image from jpeg ,<br
/> image as background and gif image on top of it …</p> ]]></content:encoded> </item> <item><title>By: Dennis</title><link>http://sniptools.com/vault/generating-jpggifpng-thumbnails-in-php-using-imagegif-imagejpeg-imagepng#comment-1017</link> <dc:creator>Dennis</dc:creator> <pubDate>Wed, 25 Oct 2006 14:51:38 +0000</pubDate> <guid
isPermaLink="false">http://sniptools.com/cms/?p=40#comment-1017</guid> <description>Great code!
Thank you for sharing </description> <content:encoded><![CDATA[<p>Great code!<br
/> Thank you for sharing</p> ]]></content:encoded> </item> <item><title>By: CK</title><link>http://sniptools.com/vault/generating-jpggifpng-thumbnails-in-php-using-imagegif-imagejpeg-imagepng#comment-1016</link> <dc:creator>CK</dc:creator> <pubDate>Fri, 28 Jul 2006 00:39:12 +0000</pubDate> <guid
isPermaLink="false">http://sniptools.com/cms/?p=40#comment-1016</guid> <description>Yeah, i&#039;ve the similar problem. The thumbnail created will have a black line at the bottom. But this only happen to some of the pictures i&#039;ve uploaded. Please help.... thanks. </description> <content:encoded><![CDATA[<p>Yeah, i've the similar problem. The thumbnail created will have a black line at the bottom. But this only happen to some of the pictures i've uploaded. Please help.… thanks.</p> ]]></content:encoded> </item> <item><title>By: David</title><link>http://sniptools.com/vault/generating-jpggifpng-thumbnails-in-php-using-imagegif-imagejpeg-imagepng#comment-1015</link> <dc:creator>David</dc:creator> <pubDate>Sat, 28 Jan 2006 14:30:46 +0000</pubDate> <guid
isPermaLink="false">http://sniptools.com/cms/?p=40#comment-1015</guid> <description>Thanks so much for the code, this is a life saver... only one problem, all the thumbnails I create have a little black dot in the bottom right-hand corner.  I&#039;ve run into this problem on two different servers, not sure which GD versions either one is running... any ideas? </description> <content:encoded><![CDATA[<p>Thanks so much for the code, this is a life saver… only one problem, all the thumbnails I create have a little black dot in the bottom right-hand corner.  I've run into this problem on two different servers, not sure which GD versions either one is running… any ideas?</p> ]]></content:encoded> </item> <item><title>By: Bhupi8</title><link>http://sniptools.com/vault/generating-jpggifpng-thumbnails-in-php-using-imagegif-imagejpeg-imagepng#comment-1014</link> <dc:creator>Bhupi8</dc:creator> <pubDate>Sun, 13 Mar 2005 08:04:34 +0000</pubDate> <guid
isPermaLink="false">http://sniptools.com/cms/?p=40#comment-1014</guid> <description>Hello,This is working on IE but not on Mozilla/Netscape.? </description> <content:encoded><![CDATA[<p>Hello,</p><p>This is working on IE but not on Mozilla/Netscape.?</p> ]]></content:encoded> </item> <item><title>By: soban [BG]</title><link>http://sniptools.com/vault/generating-jpggifpng-thumbnails-in-php-using-imagegif-imagejpeg-imagepng#comment-1013</link> <dc:creator>soban [BG]</dc:creator> <pubDate>Sun, 13 Feb 2005 16:27:30 +0000</pubDate> <guid
isPermaLink="false">http://sniptools.com/cms/?p=40#comment-1013</guid> <description>(Sorry for my English)
A little improved function -&lt;?php
function thumbgenerator ( $image, $saveorshow, $quality, $thumbsize , $savename){ // v.1 by Soban
$handle = @imagecreatefromjpeg( $image );
$x = imagesx ( $handle ); // Image Original Width
$y = imagesy ( $handle ); // Image Original Height// Calculating whitch side is larger
if ( $x &gt; $y ){
$max = $x;
$min = $y;
}
if ( $x &lt;= $y ){
$max = $y;
$min = $x;
}
$rate = $max / $thumbsize; // Thumbnail Ratio
$final_x = $x / $rate;
$final_y = $y / $rate;
if( $final_x &gt; $x ) {
$final_x = $x;
$final_y = $y;
}
$final_x = ceil ( $final_x ); // Thubnail Width
$final_y = ceil ( $final_y ); // Thubnail Height
$black_picture = imagecreatetruecolor ( $final_x, $final_y ); // Generating blank image for thumbnail
imagefill ( $black_picture, 0, 0, imagecolorallocate ( $black_picture , 255, 255, 255 ) );
imagecopyresampled ( $black_picture, $handle, 0, 0, 0, 0, $final_x, $final_y, $x, $y );
imagestring ($black_picture, 1, $final_x-4, $final_y-8, &quot;.&quot;, imagecolorallocate ( $black_picture, 0, 0, 0 ) );
if ( $saveorshow == &#039;show&#039; ) { header ( &#039;Content-type: image/jpeg&#039; ); imagejpeg ( $black_picture, &#039;&#039;, $quality); }
if ( $saveorshow == &#039;save&#039; ) imagejpeg ( $black_picture, $savename, $quality);
if ( $saveorshow == &#039;save&amp;show&#039; )  { header ( &#039;Content-type: image/jpeg&#039; ); imagejpeg ( $black_picture, &#039;&#039;, $quality); imagejpeg ( $black_picture, $savename, $quality); }
imagedestroy ( $handle );
imagedestroy ( $black_picture );
}
thumbgenerator (&#039;images/030.jpg&#039;, &#039;save&#039;, 10, 100, &#039;thumbs/newimage1.jpg&#039;);
thumbgenerator (&#039;images/030.jpg&#039;, &#039;save&#039;, 20, 100, &#039;thumbs/newimage2.jpg&#039;);
thumbgenerator (&#039;images/030.jpg&#039;, &#039;save&#039;, 30, 100, &#039;thumbs/newimage3.jpg&#039;);
thumbgenerator (&#039;images/030.jpg&#039;, &#039;save&#039;, 40, 100, &#039;thumbs/newimage4.jpg&#039;);
thumbgenerator (&#039;images/030.jpg&#039;, &#039;save&#039;, 50, 100, &#039;thumbs/newimage5.jpg&#039;);
thumbgenerator (&#039;images/030.jpg&#039;, &#039;save&#039;, 60, 100, &#039;thumbs/newimage6.jpg&#039;);
thumbgenerator (&#039;images/030.jpg&#039;, &#039;save&#039;, 70, 100, &#039;thumbs/newimage7.jpg&#039;);
thumbgenerator (&#039;images/030.jpg&#039;, &#039;save&#039;, 80, 100, &#039;thumbs/newimage8.jpg&#039;);
thumbgenerator (&#039;images/030.jpg&#039;, &#039;save&#039;, 90, 100, &#039;thumbs/newimage9.jpg&#039;);
thumbgenerator (&#039;images/030.jpg&#039;, &#039;save&amp;show&#039;, 100, 160, &#039;thumbs/newimage.jpg&#039;);
?&gt;</description> <content:encoded><![CDATA[<p>(Sorry for my English)<br
/> A little improved function -</p><p>&lt;?php<br
/> function thumbgenerator ( $image, $saveorshow, $quality, $thumbsize , $savename){ // v.1 by Soban<br
/> $handle = @imagecreatefromjpeg( $image );<br
/> $x = imagesx ( $handle ); // Image Original Width<br
/> $y = imagesy ( $handle ); // Image Original Height</p><p>// Calculating whitch side is larger<br
/> if ( $x &gt; $y ){<br
/> $max = $x;<br
/> $min = $y;<br
/> }<br
/> if ( $x &lt;= $y ){<br
/> $max = $y;<br
/> $min = $x;<br
/> }<br
/> $rate = $max / $thumbsize; // Thumbnail Ratio<br
/> $final_x = $x / $rate;<br
/> $final_y = $y / $rate;<br
/> if( $final_x &gt; $x ) {<br
/> $final_x = $x;<br
/> $final_y = $y;<br
/> }<br
/> $final_x = ceil ( $final_x ); // Thubnail Width<br
/> $final_y = ceil ( $final_y ); // Thubnail Height<br
/> $black_picture = imagecreatetruecolor ( $final_x, $final_y ); // Generating blank image for thumbnail<br
/> imagefill ( $black_picture, 0, 0, imagecolorallocate ( $black_picture , 255, 255, 255 ) );<br
/> imagecopyresampled ( $black_picture, $handle, 0, 0, 0, 0, $final_x, $final_y, $x, $y );<br
/> imagestring ($black_picture, 1, $final_x-4, $final_y-8, ".", imagecolorallocate ( $black_picture, 0, 0, 0 ) );<br
/> if ( $saveorshow == 'show' ) { header ( 'Content-type: image/jpeg' ); imagejpeg ( $black_picture, '', $quality); }<br
/> if ( $saveorshow == 'save' ) imagejpeg ( $black_picture, $savename, $quality);<br
/> if ( $saveorshow == 'save&amp;show' )  { header ( 'Content-type: image/jpeg' ); imagejpeg ( $black_picture, '', $quality); imagejpeg ( $black_picture, $savename, $quality); }<br
/> imagedestroy ( $handle );<br
/> imagedestroy ( $black_picture );<br
/> }<br
/> thumbgenerator ('images/030.jpg', 'save', 10, 100, 'thumbs/newimage1.jpg');<br
/> thumbgenerator ('images/030.jpg', 'save', 20, 100, 'thumbs/newimage2.jpg');<br
/> thumbgenerator ('images/030.jpg', 'save', 30, 100, 'thumbs/newimage3.jpg');<br
/> thumbgenerator ('images/030.jpg', 'save', 40, 100, 'thumbs/newimage4.jpg');<br
/> thumbgenerator ('images/030.jpg', 'save', 50, 100, 'thumbs/newimage5.jpg');<br
/> thumbgenerator ('images/030.jpg', 'save', 60, 100, 'thumbs/newimage6.jpg');<br
/> thumbgenerator ('images/030.jpg', 'save', 70, 100, 'thumbs/newimage7.jpg');<br
/> thumbgenerator ('images/030.jpg', 'save', 80, 100, 'thumbs/newimage8.jpg');<br
/> thumbgenerator ('images/030.jpg', 'save', 90, 100, 'thumbs/newimage9.jpg');<br
/> thumbgenerator ('images/030.jpg', 'save&amp;show', 100, 160, 'thumbs/newimage.jpg');<br
/> ?&gt;</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 6/8 queries in 0.003 seconds using disk: basic
Object Caching 579/579 objects using disk: basic

Served from: www.sniptools.com @ 2012-05-21 20:49:52 -->
