More and more digital camera models that incorporate a position sensor capable of determining the camera orientation (horizontal or vertical) when taking a picture. Known
orientation is easy to record in the corresponding field photo EXIF \u200b\u200bdata of the same, so that software display can show it in the correct orientation without requiring any manual intervention.
Since there are many digital cameras do not have such mechanisms, and the task of rotating photos becomes a bit heavy when handling large series, has tried to develop a tool to facilitate or at least make a little easier the task of successfully guiding our photos.
seems quite reasonable to assume that no one wants their photos to degrade, so we're going to make this shift with tools to make the necessary changes without having to reapply encoder algorithm (we refer to Jpeg format images, which involves a lossy compression). In Linux we have two utilities that can perform these tasks without affecting the quality of our photos: jpegtran and exiftran .
For those who use Ubuntu, the first of these utilities seem the most appropriate, because although both are included in the official repositories, jpegtran only has support from Canonical. However, exiftran seems more advisable, because judging from the description, make amendments to a more consistent way, leaving the information in the EXIF \u200b\u200bfields in line with the new direction we have taken to photography.
At issue in this paper is as follows: Prepare a script for the rotation of images and integrate them in Nautilus so that its use is convenient and simple for users of any level.
First, install the package exiftran either from Synaptic or from the command line:
$ sudo apt-get install exiftran
then prepare scripts that will take care of making the rotation. To be integrated into Nautilus, must be in the proper location:
~ / .gnome2/nautilus-scripts
Since we have other scripts, you might want to merge them into new directory:
$ mkdir ~ / .gnome2/nautilus-scripts/jpeg-ls
script below is created with your favorite editor, eg:
$ vi ~ / .gnome2/nautilus-scripts / jpeg-ls/lrotate
# / bin / bash
for URI in $ NAUTILUS_SCRIPT_SELECTED_FILE_PATHS;
do
mime_type = 'file - mime-type-bp `$ URI;
if [$ mime_type == "image / jpeg"] Then
exiftran-2i $ URI
fi done
This first script performs the rotation to the left (lrotate: Rotate Left), and likewise rrotate create the script, which simply change a parameter in the command call exiftran:
exiftran-9i $ URI
The script only runs on the selected files which is
mime-type image / jpeg
Once these scripts, simply give them execute permissions $ chmod + x ~ / .gnome2/nautilus-scripts/jpeg-ls /? rotate
And we have a menu in Nautilus to rotate your photos very simple. To access the menu, you select the photos to rotate and with the right mouse button in the category of scripts, shows the script to apply. To do this the picture will be rotated and, while Nautilus not always aware of changes and sometimes it is necessary to force a refresh to display the new thumbnail, and correctly oriented.
0 comments:
Post a Comment