summaryrefslogtreecommitdiff
path: root/jpeg-utils.h
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2008-07-27 19:13:28 +0200
committerTomas Bzatek <tbzatek@users.sourceforge.net>2008-07-27 19:13:28 +0200
commit510fff156db65795cbf211e7910a67fb316cb404 (patch)
treedfbec486ffeab2d6886f9f51863f723a2d5cd574 /jpeg-utils.h
downloadcataract-510fff156db65795cbf211e7910a67fb316cb404.tar.xz
Initial commitv0.99.0
Diffstat (limited to 'jpeg-utils.h')
-rw-r--r--jpeg-utils.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/jpeg-utils.h b/jpeg-utils.h
new file mode 100644
index 0000000..56bb51d
--- /dev/null
+++ b/jpeg-utils.h
@@ -0,0 +1,65 @@
+/* Cataract - Static web photo gallery generator
+ * Copyright (C) 2008 Tomas Bzatek <tbzatek@users.sourceforge.net>
+ *
+ * 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.
+ */
+#include <glib.h>
+
+
+typedef struct {
+ char *datetime;
+ char *camera_model;
+ char *iso;
+ char *focal_length;
+ char *focal_length_35mm;
+ char *aperture;
+ char *exposure;
+ char *flash;
+ unsigned long width;
+ unsigned long height;
+} TExifData;
+
+
+/*
+ * get_exif: retrieve EXIF info from a JPEG image
+ */
+int get_exif (const char *filename, TExifData *data);
+
+/*
+ * free_exif_struct: free allocated structure
+ */
+void free_exif_data (TExifData *data);
+
+
+/*
+ * resize_image: resize image pointed by src and save result to dst
+ */
+gboolean resize_image (const char *src, const char *dst,
+ int size_x, int size_y,
+ int quality);
+
+/*
+ * get_image_sizes: retrieve image dimensions
+ */
+void get_image_sizes (const char *img,
+ unsigned long *width, unsigned long *height);
+
+
+/*
+ * 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);
+