[Clipart] [Open Clip Art Library] no snapshots

Greg Bulmash oneminuteinspirations at gmail.com
Wed Sep 5 00:05:06 PDT 2007


>> Jon Phillips wrote:
>>> On Mon, 2007-09-03 at 17:28 +0000, hardcoal at fantomview.com wrote:
>>>> hi your website is great
>>>> but why you dont put a snapshot
>>>> near each creation so you can browse quickly?
>>>>
>>>> tnx avshalom
>>>> _______________________________________________
>>>> clipart mailing list
>>>> clipart at lists.freedesktop.org
>>>> http://lists.freedesktop.org/mailman/listinfo/clipart
>>> We would like to, but don't have the man-power to do the development on
>>> at the moment. Would you like to help us? If so, please join the mailing
>>> list.
>>>
>>> Jon

Anyhoo... ImageMagick does a pretty fair SVG to bitmap conversion that's 
relatively easy to automate.  Just put the directories where the SVGs 
live in the script below... Badabing - 400DPI jpegs (for high-res uses, 
which can then be batch resized into thumbnails).  Want smaller? Reduce 
the DPI by changing the 400 to 72 or 15 or whatever.

<?php

$dir[0] = "path/to/svg/directory/1";
$dir[1] = "path/to/svg/directory/2";
$dir[2] = "path/to/svg/directory/3";


for($i =0; $i<count($dir); $i++){
	$svgdir = $dir[$i];

    if ($dh = opendir($svgdir)) {
	while ($file = readdir($dh)){
	    $svgname = $file;
                  if(preg_match("/\.svg$/",$svgname)){
		   $myfile = str_replace(".svg",".jpg",$svgname);
    		   exec("convert -density 400 $svgdir/epstuff/$svgname
			$svgdir/epstuff/$myfile");	
			}
		}
	}
}

?>




More information about the clipart mailing list