Image::Size is fine, if size is the only thing, which matters. Sometimes, however, it isn’t enough, and when that is the case Image::Info (again fetched from CPAN) is your friend. Point it to a file (through various methods), and it will return a hash with all the information available about the image you pointed at. Most popular formats are supported.
#!/usr/bin/perl -w use strict; use Image::Info; # Just fetch the size my $imgInfo = Image::Info::image\_info("test.
With the help of ImageMagick you can automagically use Perl to create thumbnails. The example below is quite rude and makes a 50 by 50 thumbnail (no matter which size and shape the master had). Before using it in a real world scenario, check the aspect ratio, the size of the original image and what ever may be applicable.
#!/usr/bin/perl -w use strict; use Image::Magick; my $image = Image::Magick->new(magick=>'JPEG'); my $x = $image->Read('test.
Turning images is quite simple. In the example below an image is turned 90 degrees clockwise, wirtten to a file, turned another 90 degress and written to a file again.
#!/usr/bin/perl -w use strict; use Image::Magick; my $image = Image::Magick->new(magick=>'JPEG'); my $x = $image->Read('test.jpg'); $x = $image->Rotate(degrees=>90); # 90 degress clockwise $x = $image->Write('test.90.jpg'); $x = $image->Rotate(degrees=>90); # Another 90 degress clockwise $x = $image->Write('test.180.jpg'); exit();
Appleinsider has an interesting little story. It reports how the iPhone usage shocks Google
being far above the expectations. I don’t have any expectations, have so far not used nor touched an iPhone, but frankly you shouldn’t be too surprised. Sure I’ll probably get blamed as an Apple fanboy, but I hardly know any other company who is able to - so successfully - match the possibilities of technology with consumer desires.
If you’re part of a larger team developing (and sharing) code, it is a pretty good idea to have some common standards. In the PHP work, such a set of common standards include the PEAR Coding Standards. While it may be a challenge to agree on standards, it can be done - the hard part is following the standards.
One excellent tool to help you check for standards compliance is the PHP CodeSniffer.