Commit 0c5f71f2 authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

fixed saving of images rotated by the embedded orientation

the embedded orientation was considered twice
parent c6828f4a
......@@ -264,28 +264,13 @@ write_buffer_ready_cb (void **buffer,
}
if (self->priv->adjust_orientation && gth_main_extension_is_active ("image_rotation")) {
GthMetadata *metadata;
metadata = (GthMetadata *) g_file_info_get_attribute_object (self->priv->destination_file->info, "Embedded::Image::Orientation");
if (metadata != NULL) {
const char *value;
value = gth_metadata_get_raw (metadata);
if (value != NULL) {
GthTransform transform;
transform = (GthTransform) strtol (value, (char **) NULL, 10);
if (transform != 1) {
apply_transformation_async (self->priv->destination_file,
transform,
JPEG_MCU_ACTION_ABORT,
gth_task_get_cancellable (GTH_TASK (self)),
transformation_ready_cb,
self);
appling_tranformation = TRUE;
}
}
}
apply_transformation_async (self->priv->destination_file,
GTH_TRANSFORM_NONE,
JPEG_MCU_ACTION_ABORT,
gth_task_get_cancellable (GTH_TASK (self)),
transformation_ready_cb,
self);
appling_tranformation = TRUE;
}
if (! appling_tranformation)
......
......@@ -2456,33 +2456,18 @@ copy_current_file (GthWebExporter *self)
if (gth_main_extension_is_active ("image_rotation")
&& g_content_type_equals (gth_file_data_get_mime_type (image_data->file_data), "image/jpeg"))
{
GthMetadata *metadata;
metadata = (GthMetadata *) g_file_info_get_attribute_object (image_data->file_data->info, "Embedded::Image::Orientation");
if (metadata != NULL) {
const char *value;
value = gth_metadata_get_raw (metadata);
if (value != NULL) {
GthTransform transform;
transform = (GthTransform) strtol (value, (char **) NULL, 10);
if (transform != 1) {
GthFileData *file_data;
file_data = gth_file_data_new (destination, image_data->file_data->info);
apply_transformation_async (file_data,
transform,
JPEG_MCU_ACTION_TRIM,
gth_task_get_cancellable (GTH_TASK (self)),
transformation_ready_cb,
self);
appling_tranformation = TRUE;
g_object_unref (file_data);
}
}
}
GthFileData *file_data;
file_data = gth_file_data_new (destination, image_data->file_data->info);
apply_transformation_async (file_data,
GTH_TRANSFORM_NONE,
JPEG_MCU_ACTION_TRIM,
gth_task_get_cancellable (GTH_TASK (self)),
transformation_ready_cb,
self);
appling_tranformation = TRUE;
g_object_unref (file_data);
}
if (! appling_tranformation)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment