/* Cataract - Static web photo gallery generator * Copyright (C) 2008 Tomas Bzatek * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __CGG__JPEG_UTILS_H__ #define __CGG__JPEG_UTILS_H__ #include #include "setup.h" G_BEGIN_DECLS #define SQUARED_SIMPLE_SHAVE_AMOUNT 5 /* percent */ /* TODO: we want to have numerical values here at some point in the future */ typedef struct { gchar *datetime; gchar *camera_model; gchar *iso; gchar *focal_length; gchar *focal_length_35mm; gchar *aperture; gchar *exposure; gchar *flash; gchar *exif_software; gchar *exif_imgdesc; gchar *exif_artist; gchar *exif_copyright; gchar *exif_usercomment; gchar *iptc_objectname; gchar *iptc_copyright; gchar *iptc_credit; gchar *iptc_caption; gchar *iptc_author; gchar *jpeg_comment; } TExifData; /* * get_exif: retrieve EXIF info from a JPEG image */ TExifData * get_exif (const gchar *filename); /* * free_exif_struct: free allocated structure */ void free_exif_data (TExifData *data); /* * resize_image: resize image pointed by src and save result to dst * - setting thumbnail flag will remove all profiles and optimize for size */ gboolean resize_image (const gchar *src, const gchar *dst, unsigned long size_x, unsigned long size_y, int quality, gboolean thumbnail, ThumbnailSquareType squared_thumbnail_type, gboolean autorotate); /* * get_image_sizes: retrieve image dimensions */ void get_image_sizes (const gchar *img, unsigned long *width, unsigned long *height, gboolean autorotate); /* * calculate_sizes: calculate maximal image sizes within specified limits keeping aspect ratio */ void calculate_sizes (const unsigned long max_width, const unsigned long max_height, unsigned long *width, unsigned long *height); /* * modify_exif: - strip thumbnail stored in EXIF table * - add copyright to Exif::Image::Copyright and Iptc::Application2::Copyright */ void modify_exif (const gchar *filename, gboolean strip_thumbnail, const gchar *add_copyright); G_END_DECLS #endif /* __CGG__JPEG_UTILS_H__ */