Wednesday, March 30, 2011

ImageMagick: Make thumbs of images

For example to make jpg thumbs of all tiff images in a current director one can use:for f in *.tiff; do bname=`basename $f .tiff` ; convert -resize 256x256 $f ./thumbs/$bname.jpg; done

Thursday, March 17, 2011

ImageMagick: Flatten and convert an image to grayscale

In short, to flatten and convert to grayscale all images in current director one can use: mogrify -flatten -type Grayscale *or mogrify -flatten -alpha remove *.tiff

Tuesday, March 08, 2011

An example file upload progress monitoring in Zend Framework 1.11

An example web application demonstrating usage of Zend_ProgressBar and jquery progressbar for monitoring progress of file uploads in Zend Framework 1.11.3.

Since file uploads are done to the folder APPLICATION_PATH/uploads, the application tries to create this folder if it does not exists. For this reason APPLICATION_PATH should be writable, or uploads folder created manually with necessary rights. The application also requires 'uploadprogress' PECL package since it uses 'uploadprogress_get_info' function for getting the information about upload progress.

The source code is at GitHub. Most action happens in indexController.php and index.phtml.