Schlagwort: images

Free giveaway

airguitarzuverschenken.JPG

[via Torgen]

Lu Yuanfang – Make anything seem possible

Ein großartiges Stöckchen, was ich da bei Spreeblick gefunden und aufgehoben habe.

album_stoeckchen.jpg

Die Regeln:

Der Name deiner Band wird der Titel des ersten Artikels nach Klick auf diesen Link:
http://en.wikipedia.org/wiki/Special:Random

Dein Album wird nach den letzten vier Worten des letzten Zitats dieser Seite benannt:
http://www.quotationspage.com/random.php3

Das dritte Bild auf dieser Seite wird dein Album-Cover:
http://www.flickr.com/explore/interesting/7days

Wer Lust hat, darf das Stöckchen aufheben …

No more hotlinking

I discovered from my webserver's logs, that more and more people hotlink to my photos and images – an attitude I don't really appreciate.
So I wrote a little hotlink filter with .htaccess:

[code]RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(mm\.)?smile-to-me\.de/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule \.(jpe?g|gif|bmp|png)$ images/hotlinking.gif [L][/code]

So when someone tries to hotlink to images hosted on my server, he gets this nice pic:

Künstliche Intelligenz auf Rechnung

Vielleicht sollte ich das mal ausprobieren …

igal auto rotation of images

igal is a very nice perl script which creates html picture galleries. I use this script for my photos since it’s easy to use and I like the film reel effect in the galleries.
But there is one annoying point: It does not detect, if pictures are rotated (if they have a rotation flag in the EXIF header). So sometimes pictures appeared wrongly rotated in the gallery and you had to rotate them manually and recreate the gallery.
So I added the functionality to the igal script, which was not as hard as I thought first. It uses jhead, a program to manipulate the EXIF header of a JPEG file. If you run jhead on a rotated file, it gives you information like this:

kati@hitchhiker:/media/sda1/DCIM/132CANON$ jhead IMG_3263.JPG
File name : IMG_3263.JPG
File size : 830969 bytes
File date : 2006:04:01 20:00:26
Camera make : Canon
Camera model : Canon DIGITAL IXUS v2
Date/Time : 2006:04:01 20:00:28
Resolution : 1600 x 1200
Orientation : rotate 90
Flash used : Yes (auto)
Focal length : 5.4mm (35mm equivalent: 37mm)
CCD width : 5.23mm
Exposure time: 0.013 s (1/80)
Aperture : f/2.8
Whitebalance : Auto
Metering Mode: matrix

I can use this information to detect if the pic is rotated by searching for the orientation flag and read the value (90 in this case). The Perl code in the igal script for detecting and autorotating is this:

print "Check if rotation is necessary ";
for($i=0; $i < $nfiles; $i++)
{
print ".";
$file=$imgfiles[$i];
my $result = `jhead $file | grep Orientation | cut -d \" \" -f5`; # return as list, one line is one element
if($result!=0)
{
chomp($result); #cut the \n at the end
print "Rotating image $file for $result degrees ...\n";
system("convert -rotate $result $file $file" );
#exif-rotation tag deletion
system("jhead -norot $file" );
}

}
print " done!\n";

All images that shall appear in the gallery are in an array $imgfiles which I can iterate. I get the jhead info for every file (image), grep for the string „Orientation“ and cut the last substring which is the orientation value (delimiter of substrings is a blank \“ \“). This value is stored in the variable $result, chomp deletes the return character at the end. It is used with the convert script (this one comes with the imagemagick package, it’s a command line script for image manipulation), which actually performs the rotation of the image. Last it runs again the jhead script and deletes the Orientation tag since the image is not rotated anymore. That’s it. Here is the complete igal script.

If you like to add the information from the EXIF header in the slides of the gallery, check out this posting on how to hack igal for doing so.

The porn cannot be displayed

Just found while looking for some hints for compiling an application:
No porn here!

Zwei Bilder


Ein schönes gelbes Rapsfeld und strahlendes Wetter – geknipst heute mit dem Handy auf der Heimfahrt


Das Auto, dass wir am Samstag gekauft haben (allerdings ohne den Fahrer drin) 🙂