...
 
Commits (57)
SUBDIRS = m4 copy-n-paste data po gthumb extensions tests help
ACLOCAL_AMFLAGS = -I m4
AMCFLAGS = -fPIC -DPIC
EXTRA_DIST = \
AUTHORS \
......
version 2.12.4
--------------
New or updated application translations:
* Estonian (Rene Pärts)
* French (Bruno Brouard)
* Hungarian (Gabor Kelemen)
* Indonesian (Andika Triwidada)
* Swedish (Daniel Nylander)
New or updated manual translations:
* Basque (Iñaki Larrañaga Murgoitio)
* Deutsch (Mario Blättermann)
version 2.12.3
--------------
Bugs fixed:
* Fixed crash when closing a window while the video viewer is active.
* Prevent focus stealing when launching an application.
* Make PgUp/PgDown navigation work when started in fullscreen mode. (#642848)
* Image scrolling is now faster.
* Web albums: fixed progress dialog not showing again after exporting
the first time.
* Fixed other bugs that caused crashes in some cases.
New or updated application translations:
* Danish (Joe Hansen)
* Swedish (Daniel Nylander)
version 2.12.2
--------------
Bugs fixed:
* Correctly activate the default extensions when started the first
time. (#635475)
* Enable building with exiv2-0.21 (Alexandre Rostovtsev) (#349150)
* Launch a single instance of Gimp when opening many files at once. (#637234)
* Fixed folder renaming. (#635417)
* Fixed search in catalogs not ginving any result. (#638009)
* Fixed crash on thumbnail generation.
* Web Albums: update the file info when scaling the original image. (#637920)
New or updated application translations:
* Basque (Iñaki Larrañaga Murgoitio)
* Deutsch (Mario Blättermann)
* Japanese (Takeshi AIHANA)
* Russian (Yuri Myasoedov)
New or updated manual translations:
* German (Mario Blättermann)
version 2.12.1
--------------
Bugs fixed:
* When moving files do not delete the source if an error occurs.
(#634615)
* Thumbnails not shown when changing file sorting. (#631816)
* Don't change image on mouse-wheel when editing an image. (#631205)
* Respect the PREF_SAVE_THUMBNAILS and PREF_THUMBNAIL_LIMIT
preference settings. (#631997)
* Fixed crash when a file is renamed. (#634050)
* PicasaWeb importer/exporter: let it work with non google email
addresses as well. (#634052)
* Facebook uploader: allow to upload to existing albums as well.
(#632498)
* Fixed build on BSD systems. (#630837, #630836)
New or updated application translations:
* Catalan (Sílvia Miranda)
* Español (Jorge González)
* Greek (Kostas Papadimas)
* Italian (Milo Casagrande)
New or updated manual translations:
* Español (Jorge González)
* French (Bruno Brouard)
* Slovenian (Matej Urbančič)
version 2.12.0
--------------
......@@ -108,22 +198,22 @@ version 2.11.90
New features and user visible changes:
* Slideshow: added ability to view the images in random order (#621244)
* Change date tool: allow to set the date without touching the time
* Change date tool: allow to set the date without touching the time
(#622245)
* Video player: display the video speed in the status bar and allow
* Video player: display the video speed in the status bar and allow
to change speed from 0.03 to 36.0 (#624454)
* Removed the "do not change folder" option from the preferences dialog
as it was useless.
* Added ability to organize files by tag: the organize command can
* Added ability to organize files by tag: the organize command can
organize files by tag, creating a catalog for each tag found in the
scanned images.
* The "fit window to image" is now a toggle action. (#617488)
* Added two orientation tools: added tool to physically rotate the
images according to their embedded orientation; and a tool to reset
* Added two orientation tools: added tool to physically rotate the
images according to their embedded orientation; and a tool to reset
the embedded orientation without rotating the images.
* Removed the preferences button from the import dialogs: instead of
the overwrite option just use the overwrite dialog when a file is
going to be overwritten; the rotate option is used only when
* Removed the preferences button from the import dialogs: instead of
the overwrite option just use the overwrite dialog when a file is
going to be overwritten; the rotate option is used only when
importing from a device and is set in the general preferences dialog.
* New application icon.
......@@ -141,7 +231,7 @@ version 2.11.90
* Correctly hide and show the mouse pointer in the video player.
* Fixed search test when the "match any" option was active.
* Flicker importer: fixed crash when the image url is not found
New or updated application translations:
* Czech (Marek Černocký)
......
AC_PREREQ(2.63)
AC_INIT([gthumb],[2.12.0],[http://bugzilla.gnome.org/enter_bug.cgi?product=gthumb])
AC_INIT([gthumb],[2.12.4],[http://bugzilla.gnome.org/enter_bug.cgi?product=gthumb])
AM_INIT_AUTOMAKE([1.9 foreign])
AC_CONFIG_HEADERS([config.h])
......
......@@ -48,7 +48,7 @@
<owner>gthumb</owner>
<type>list</type>
<list_type>string</list_type>
<default>[]</default>
<default>[default]</default>
<locale name="C">
<short></short>
<long>
......
......@@ -181,7 +181,7 @@ gth_browser_activate_action_catalog_new (GtkAction *action,
GFile *parent;
GthFileSource *file_source;
GFile *gio_parent;
GError *error;
GError *error = NULL;
GFile *gio_file;
name = _gtk_request_dialog_run (GTK_WINDOW (browser),
......
......@@ -257,7 +257,7 @@ new_catalog_button_clicked_cb (GtkWidget *widget,
GthFileData *selected_parent;
GFile *parent;
GFile *gio_parent;
GError *error;
GError *error = NULL;
GFile *gio_file;
name = _gtk_request_dialog_run (GTK_WINDOW (data->dialog),
......
......@@ -416,7 +416,7 @@ gth_file_source_catalogs_read_metadata (GthFileSource *file_source,
typedef struct {
GthFileSource *file_source;
gboolean recursive;
const char *attributes;
char *attributes;
StartDirCallback start_dir_func;
ForEachChildCallback for_each_file_func;
ReadyCallback ready_func;
......@@ -431,6 +431,7 @@ for_each_child_data_free (ForEachChildData *data)
{
_g_object_list_unref (data->to_visit);
g_object_ref (data->catalog);
g_free (data->attributes);
g_object_ref (data->file_source);
}
......@@ -630,7 +631,7 @@ gth_file_source_catalogs_for_each_child (GthFileSource *file_source,
data = g_new0 (ForEachChildData, 1);
data->file_source = g_object_ref (file_source);
data->recursive = recursive;
data->attributes = attributes;
data->attributes = g_strdup (attributes);
data->start_dir_func = start_dir_func;
data->for_each_file_func = for_each_file_func;
data->ready_func = ready_func;
......
......@@ -150,47 +150,39 @@ gth_metadata_provider_comment_write (GthMetadataProvider *self,
/* caption */
text = NULL;
metadata = (GthMetadata *) g_file_info_get_attribute_object (file_data->info, "general::title");
if (metadata == NULL)
text = g_file_info_get_attribute_string (file_data->info, "comment::caption");
else
if (metadata != NULL)
text = gth_metadata_get_raw (metadata);
gth_comment_set_caption (comment, text);
/* comment */
text = NULL;
metadata = (GthMetadata *) g_file_info_get_attribute_object (file_data->info, "general::description");
if (metadata == NULL)
text = g_file_info_get_attribute_string (file_data->info, "comment::note");
else
if (metadata != NULL)
text = gth_metadata_get_raw (metadata);
gth_comment_set_note (comment, text);
/* location */
text = NULL;
metadata = (GthMetadata *) g_file_info_get_attribute_object (file_data->info, "general::location");
if (metadata == NULL)
text = g_file_info_get_attribute_string (file_data->info, "comment::place");
else
if (metadata != NULL)
text = gth_metadata_get_raw (metadata);
gth_comment_set_place (comment, text);
/* time */
text = NULL;
metadata = (GthMetadata *) g_file_info_get_attribute_object (file_data->info, "general::datetime");
if (metadata == NULL)
metadata = (GthMetadata *) g_file_info_get_attribute_object (file_data->info, "comment::time");
if (metadata != NULL)
text = gth_metadata_get_raw (metadata);
else
text = NULL;
gth_comment_set_time_from_exif_format (comment, text);
/* keywords */
categories = (GthStringList *) g_file_info_get_attribute_object (file_data->info, "general::tags");
if (categories == NULL)
categories = (GthStringList *) g_file_info_get_attribute_object (file_data->info, "comment::categories");
if (categories != NULL) {
GList *list;
GList *scan;
......
......@@ -112,13 +112,13 @@ gth_edit_comment_page_real_set_file_list (GthEditMetadataPage *base,
if (tags != NULL) {
char *value;
value = gth_string_list_join (tags, ", ");
value = gth_string_list_join (tags, ",");
gth_tags_entry_set_text (GTH_TAGS_ENTRY (self->priv->tags_entry), value);
g_free (value);
}
else
gth_tags_entry_set_text (GTH_TAGS_ENTRY (self->priv->tags_entry), "");
gth_tags_entry_set_text (GTH_TAGS_ENTRY (self->priv->tags_entry), NULL);
metadata = (GthMetadata *) g_file_info_get_attribute_object (self->priv->info, "general::rating");
if (metadata != NULL) {
......
......@@ -497,19 +497,19 @@ set_attributes_from_tagsets (GFileInfo *info)
static const char *
get_exif_default_category (const Exiv2::Exifdatum &md)
{
#if EXIV2_TEST_VERSION(0, 21, 0)
if (Exiv2::ExifTags::isMakerGroup(md.groupName()))
#else
if (Exiv2::ExifTags::isMakerIfd(md.ifdId()))
#endif
return "Exif::MakerNotes";
switch (md.ifdId()) {
case Exiv2::ifd1Id:
if (md.groupName().compare("Thumbnail") == 0)
return "Exif::Thumbnail";
case Exiv2::gpsIfdId:
else if (md.groupName().compare("GPSInfo") == 0)
return "Exif::GPS";
case Exiv2::iopIfdId:
else if (md.groupName().compare("Iop") == 0)
return "Exif::Versions";
default:
break;
}
return "Exif::Other";
}
......@@ -531,7 +531,11 @@ exiv2_read_metadata (Exiv2::Image::AutoPtr image,
stringstream description;
if (! md->tagLabel().empty())
description << md->tagLabel();
else if (md->ifdId () > Exiv2::ifd1Id)
#if EXIV2_TEST_VERSION(0, 21, 0)
else if (Exiv2::ExifTags::isMakerGroup(md->groupName()))
#else
else if (Exiv2::ExifTags::isMakerIfd(md->ifdId()))
#endif
// Must be a MakerNote - include group name
description << md->groupName() << "." << md->tagName();
else
......@@ -1135,9 +1139,9 @@ exiv2_generate_thumbnail (const char *uri,
Exiv2::ExifData &ed = image->exifData();
long orientation = ed["Exif.Image.Orientation"].toLong();
long image_width = ed["Exif.Photo.PixelXDimension"].toLong();
long image_height = ed["Exif.Photo.PixelYDimension"].toLong();
long orientation = (ed["Exif.Image.Orientation"].count() > 0) ? ed["Exif.Image.Orientation"].toLong() : 1;
long image_width = (ed["Exif.Photo.PixelXDimension"].count() > 0) ? ed["Exif.Photo.PixelXDimension"].toLong() : -1;
long image_height = (ed["Exif.Photo.PixelYDimension"].count() > 0) ? ed["Exif.Photo.PixelYDimension"].toLong() : -1;
if ((orientation != 1) || (image_width <= 0) || (image_height <= 0))
return NULL;
......
......@@ -172,6 +172,21 @@ gth_metadata_provider_exiv2_write (GthMetadataProvider *self,
g_file_info_set_attribute_object (file_data->info, tags_to_update[i], metadata);
}
}
else {
const char *tags_to_remove[] = {
"Exif::Image::ImageDescription",
"Xmp::tiff::ImageDescription",
"Iptc::Application2::Headline",
"Exif::Photo::UserComment",
"Xmp::dc::description",
"Iptc::Application2::Caption",
NULL
};
int i;
for (i = 0; tags_to_remove[i] != NULL; i++)
g_file_info_remove_attribute (file_data->info, tags_to_remove[i]);
}
metadata = g_file_info_get_attribute_object (file_data->info, "general::title");
if (metadata != NULL) {
......@@ -179,6 +194,10 @@ gth_metadata_provider_exiv2_write (GthMetadataProvider *self,
g_file_info_set_attribute_object (file_data->info, "Xmp::dc::title", metadata);
g_file_info_set_attribute_object (file_data->info, "Iptc::Application2::Headline", metadata);
}
else {
g_file_info_remove_attribute (file_data->info, "Xmp::dc::title");
g_file_info_remove_attribute (file_data->info, "Iptc::Application2::Headline");
}
metadata = g_file_info_get_attribute_object (file_data->info, "general::location");
if (metadata != NULL) {
......@@ -186,6 +205,10 @@ gth_metadata_provider_exiv2_write (GthMetadataProvider *self,
g_file_info_set_attribute_object (file_data->info, "Xmp::iptc::Location", metadata);
g_file_info_set_attribute_object (file_data->info, "Iptc::Application2::LocationName", metadata);
}
else {
g_file_info_remove_attribute (file_data->info, "Xmp::iptc::Location");
g_file_info_remove_attribute (file_data->info, "Iptc::Application2::LocationName");
}
metadata = g_file_info_get_attribute_object (file_data->info, "general::tags");
if (metadata != NULL) {
......@@ -194,12 +217,18 @@ gth_metadata_provider_exiv2_write (GthMetadataProvider *self,
g_file_info_set_attribute_object (file_data->info, "Xmp::iptc::Keywords", metadata);
g_file_info_set_attribute_object (file_data->info, "Iptc::Application2::Keywords", metadata);
}
else {
g_file_info_remove_attribute (file_data->info, "Xmp::iptc::Keywords");
g_file_info_remove_attribute (file_data->info, "Iptc::Application2::Keywords");
}
metadata = g_file_info_get_attribute_object (file_data->info, "general::datetime");
if (metadata != NULL) {
g_object_set (metadata, "value-type", NULL, NULL);
g_file_info_set_attribute_object (file_data->info, "Exif::Image::DateTime", metadata);
}
else
g_file_info_remove_attribute (file_data->info, "Exif::Image::DateTime");
if (exiv2_write_metadata_to_buffer (&buffer,
&size,
......
......@@ -838,13 +838,14 @@ static void
activate_open_with_application_item (GtkMenuItem *menuitem,
gpointer data)
{
GthBrowser *browser = data;
GList *items;
GList *file_list;
GList *uris;
GList *scan;
GAppInfo *appinfo;
GError *error = NULL;
GthBrowser *browser = data;
GList *items;
GList *file_list;
GList *uris;
GList *scan;
GAppInfo *appinfo;
GdkAppLaunchContext *context;
GError *error = NULL;
items = gth_file_selection_get_selected (GTH_FILE_SELECTION (gth_browser_get_file_list_view (browser)));
file_list = gth_file_list_get_files (GTH_FILE_LIST (gth_browser_get_file_list (browser)), items);
......@@ -859,11 +860,16 @@ activate_open_with_application_item (GtkMenuItem *menuitem,
appinfo = g_object_get_data (G_OBJECT (menuitem), "appinfo");
g_return_if_fail (G_IS_APP_INFO (appinfo));
if (! g_app_info_launch_uris (appinfo, uris, NULL, &error))
context = gdk_app_launch_context_new ();
gdk_app_launch_context_set_screen (context, gtk_widget_get_screen (GTK_WIDGET (browser)));
gdk_app_launch_context_set_timestamp (context, 0);
gdk_app_launch_context_set_icon (context, g_app_info_get_icon (appinfo));
if (! g_app_info_launch_uris (appinfo, uris, G_APP_LAUNCH_CONTEXT (context), &error))
_gtk_error_dialog_from_gerror_show (GTK_WINDOW (browser),
_("Could not perform the operation"),
&error);
g_object_unref (context);
g_list_free (uris);
_g_object_list_unref (file_list);
_gtk_tree_path_list_free (items);
......@@ -1029,7 +1035,7 @@ fm__gth_browser_file_list_key_press_cb (GthBrowser *browser,
items = gth_file_selection_get_selected (GTH_FILE_SELECTION (gth_browser_get_file_list_view (browser)));
file_data_list = gth_file_list_get_files (GTH_FILE_LIST (gth_browser_get_file_list (browser)), items);
file_list = gth_file_data_list_to_file_list (file_data_list);
_g_launch_command (GTK_WIDGET (browser), "gimp", "Gimp", file_list);
_g_launch_command (GTK_WIDGET (browser), "gimp %U", "Gimp", file_list);
_g_object_list_unref (file_list);
_g_object_list_unref (file_data_list);
......
......@@ -60,6 +60,9 @@ gth_metadata_provider_image_read (GthMetadataProvider *self,
return;
filename = g_file_get_path (file_data->file);
if (filename == NULL)
return;
format = gdk_pixbuf_get_file_info (filename, &width, &height);
if (format != NULL) {
char *size;
......
......@@ -155,7 +155,7 @@ gth_transition_class_init (GthTransitionClass *klass)
PROP_FRAME_FUNC,
g_param_spec_pointer ("frame-func",
"Frame Function",
"The fuction used to set the current frame",
"The function used to set the current frame",
G_PARAM_READWRITE));
}
......
......@@ -762,7 +762,10 @@ gth_tag_new_loop (GthLoop *loop)
tag = g_new0 (GthTag, 1);
tag->type = loop->type;
tag->value.loop = loop;
if (loop->type == GTH_TAG_FOR_EACH_IN_RANGE)
tag->value.range_loop = (GthRangeLoop *) loop;
else
tag->value.loop = loop;
return tag;
}
......@@ -795,8 +798,8 @@ gth_tag_free (GthTag *tag)
{
gth_loop_free (tag->value.loop);
}
else if (tag->type == GTH_TAG_FOR_EACH_THUMBNAIL_CAPTION) {
gth_range_loop_free (GTH_RANGE_LOOP (tag->value.loop));
else if (tag->type == GTH_TAG_FOR_EACH_IN_RANGE) {
gth_range_loop_free (GTH_RANGE_LOOP (tag->value.range_loop));
}
else {
g_list_foreach (tag->value.attributes,
......
......@@ -238,10 +238,11 @@ void gth_range_loop_set_range (GthRangeLoop *loop,
typedef struct {
GthTagType type;
union {
GList *attributes; /* GthAttribute list */
char *html; /* html */
GList *cond_list; /* GthCondition list */
GthLoop *loop; /* a loop tag */
GList *attributes; /* GthAttribute list */
char *html; /* html */
GList *cond_list; /* GthCondition list */
GthLoop *loop; /* a loop tag */
GthRangeLoop *range_loop;
} value;
GList *document; /* GthTag list */
} GthTag;
......
......@@ -101,7 +101,7 @@ document : HTML document {
gth_loop_add_document ($1, $2);
tag = gth_tag_new_loop ($1);
$$ = g_list_prepend ($4, $1);
$$ = g_list_prepend ($4, tag);
}
| tag_if document opt_tag_else_if opt_tag_else tag_end document {
......@@ -138,23 +138,23 @@ tag_loop : FOR_EACH VARIABLE END_TAG {
else {
yyerror ("Wrong iterator: '%s', expected 'thumbnail_caption' or 'image_caption'", $2);
YYERROR;
}
}
}
| FOR_EACH VARIABLE IN expr RANGE expr END_TAG {
$$ = gth_range_loop_new ();
gth_range_loop_set_range (GTH_RANGE_LOOP ($$), $2, $4, $6);
g_free ($2);
gth_expr_unref ($4);
gth_expr_unref ($6);
}
;
;
tag_if : IF expr END_TAG {
$$ = gth_condition_new ($2);
}
| IF '"' expr '"' END_TAG {
$$ = gth_condition_new ($3);
}
......@@ -173,7 +173,7 @@ opt_tag_else_if : tag_else_if document opt_tag_else_if {
tag_else_if : ELSE_IF expr END_TAG {
$$ = gth_condition_new ($2);
}
| ELSE_IF '"' expr '"' END_TAG {
$$ = gth_condition_new ($3);
}
......@@ -211,25 +211,25 @@ tag_print : PRINT FUNCTION_NAME expr_list END_TAG {
if (gth_tag_get_type_from_name ($2) == GTH_TAG_EVAL) {
GthExpr *e;
GList *arg_list;
if ($3 == NULL) {
yyerror ("Missing argument for function 'eval', expected expression");
YYERROR;
}
e = $3->data;
arg_list = g_list_append (NULL, gth_attribute_new_expression ("expr", e));
$$ = gth_tag_new (GTH_TAG_EVAL, arg_list);
gth_expr_list_unref ($3);
}
else if (gth_tag_get_type_from_name ($2) == GTH_TAG_TRANSLATE) {
GList *arg_list = NULL;
GList *scan;
for (scan = $3; scan; scan = scan->next) {
GthExpr *e = scan->data;
if (scan == $3) {
GthCell *cell;
......@@ -237,16 +237,16 @@ tag_print : PRINT FUNCTION_NAME expr_list END_TAG {
if (cell->type != GTH_CELL_TYPE_STRING) {
yyerror ("Wrong argument type: %d, expected string", cell->type);
YYERROR;
}
}
arg_list = g_list_append (arg_list, gth_attribute_new_string ("text", cell->value.string->str));
continue;
}
arg_list = g_list_append (arg_list, gth_attribute_new_expression ("expr", e));
}
$$ = gth_tag_new (GTH_TAG_TRANSLATE, arg_list);
gth_expr_list_unref ($3);
}
else {
......@@ -407,12 +407,12 @@ expr : '(' expr ')' {
gth_expr_push_var (e, $1);
if ($3 != NULL) {
GList *scan;
for (scan = $3; scan; scan = scan->next) {
GthExpr *arg = scan->data;
GthExpr *arg = scan->data;
gth_expr_push_expr (e, arg);
gth_expr_unref (arg);
}
}
g_list_free ($3);
}
g_free ($1);
......
......@@ -811,7 +811,7 @@ gfile_get_relative_path (GFile *file,
/* construct a GFile for a GthWebExporter */
GFile *
static GFile *
get_album_file (GthWebExporter *self,
GFile *target_dir,
const char *subdir,
......@@ -824,7 +824,7 @@ get_album_file (GthWebExporter *self,
}
GFile *
static GFile *
get_html_index_dir (GthWebExporter *self,
const int page,
GFile *target_dir)
......@@ -836,7 +836,7 @@ get_html_index_dir (GthWebExporter *self,
}
GFile *
static GFile *
get_html_image_dir (GthWebExporter *self,
GFile *target_dir)
{
......@@ -844,7 +844,7 @@ get_html_image_dir (GthWebExporter *self,
}
GFile *
static GFile *
get_theme_file (GthWebExporter *self,
GFile *target_dir,
const char *filename)
......@@ -853,7 +853,7 @@ get_theme_file (GthWebExporter *self,
}
GFile *
static GFile *
get_html_index_file (GthWebExporter *self,
const int page,
GFile *target_dir)
......@@ -876,7 +876,7 @@ get_html_index_file (GthWebExporter *self,
}
GFile *
static GFile *
get_html_image_file (GthWebExporter *self,
ImageData *image_data,
GFile *target_dir)
......@@ -893,7 +893,7 @@ get_html_image_file (GthWebExporter *self,
}
GFile *
static GFile *
get_thumbnail_file (GthWebExporter *self,
ImageData *image_data,
GFile *target_dir)
......@@ -910,7 +910,7 @@ get_thumbnail_file (GthWebExporter *self,
}
GFile *
static GFile *
get_image_file (GthWebExporter *self,
ImageData *image_data,
GFile *target_dir)
......@@ -926,7 +926,7 @@ get_image_file (GthWebExporter *self,
}
GFile *
static GFile *
get_preview_file (GthWebExporter *self,
ImageData *image_data,
GFile *target_dir)
......@@ -1658,15 +1658,15 @@ gth_parsed_doc_print (GthWebExporter *self,
case GTH_TAG_FOR_EACH_IN_RANGE:
{
LoopInfo *inner_loop_info;
int i;
int first_value;
int last_value;
LoopInfo *inner_loop_info;
int i;
int first_value;
int last_value;
first_value = expression_value (self, GTH_RANGE_LOOP (tag)->first_value);
last_value = expression_value (self, GTH_RANGE_LOOP (tag)->last_value);
first_value = expression_value (self, tag->value.range_loop->first_value);
last_value = expression_value (self, tag->value.range_loop->last_value);
inner_loop_info = loop_info_new ();
inner_loop_info->iterator = g_strdup (GTH_RANGE_LOOP (tag)->iterator);
inner_loop_info->iterator = g_strdup (tag->value.range_loop->iterator);
for (i = first_value; i <= last_value; i++) {
inner_loop_info->first_item = (i == first_value);
inner_loop_info->last_item = (i == last_value);
......@@ -1804,6 +1804,7 @@ success_dialog_response_cb (GtkDialog *dialog,
break;
}
gth_task_dialog (GTH_TASK (self), FALSE, NULL);
gth_task_completed (GTH_TASK (self), self->priv->error);
}
......@@ -2365,6 +2366,31 @@ save_resized_image_ready_cd (GthFileData *file_data,
}
static const char *
get_format_description (const char *mime_type)
{
const char *description = NULL;
GSList *formats;
GSList *scan;
formats = gdk_pixbuf_get_formats ();
for (scan = formats; ! description && scan; scan = scan->next) {
GdkPixbufFormat *format = scan->data;
char **mime_types;
int i;
mime_types = gdk_pixbuf_format_get_mime_types (format);
for (i = 0; ! description && mime_types[i] != NULL; i++)
if (g_strcmp0 (mime_types[i], mime_type) == 0)
description = gdk_pixbuf_format_get_description (format);
}
g_slist_free (formats);
return description;
}
static gboolean
save_resized_image (gpointer data)
{
......@@ -2378,6 +2404,8 @@ save_resized_image (gpointer data)
image_data = self->priv->current_file->data;
if (self->priv->copy_images && (image_data->image != NULL)) {
char *filename_no_ext;
char *size;
GFile *destination;
GthFileData *file_data;
......@@ -2387,6 +2415,29 @@ save_resized_image (gpointer data)
FALSE,
(double) (self->priv->image + 1) / (self->priv->n_images + 1));
/* change the file extension to jpeg */
filename_no_ext = _g_uri_remove_extension (image_data->dest_filename);
g_free (image_data->dest_filename);
image_data->dest_filename = g_strconcat(filename_no_ext, ".jpeg", NULL);
g_free (filename_no_ext);
/* change the file type */
gth_file_data_set_mime_type (image_data->file_data, "image/jpeg");
g_file_info_set_attribute_string (image_data->file_data->info, "general::format", get_format_description ("image/jpeg"));
/* change the image dimensions info */
g_file_info_set_attribute_int32 (image_data->file_data->info, "image::width", image_data->image_width);
g_file_info_set_attribute_int32 (image_data->file_data->info, "image::height", image_data->image_height);
g_file_info_set_attribute_int32 (image_data->file_data->info, "frame::width", image_data->image_width);
g_file_info_set_attribute_int32 (image_data->file_data->info, "frame::height", image_data->image_height);
size = g_strdup_printf (_("%d × %d"), image_data->image_width, image_data->image_height);
g_file_info_set_attribute_string (image_data->file_data->info, "general::dimensions", size);
/* save the pixbuf */
destination = get_image_file (self, image_data, self->priv->tmp_dir);
file_data = gth_file_data_new (destination, NULL);
_gdk_pixbuf_save_async (image_data->image,
......
......@@ -258,7 +258,7 @@ gthumb_LDADD = \
$(LIBBRASERO_LIBS) \
$(LIBOPENRAW_LIBS) \
$(LIBSOUP_LIBS) \
$(NULL)
$(NULL)
if RUN_IN_PLACE
ui_dir = $(abs_top_srcdir)/data/ui
......@@ -274,7 +274,15 @@ endif
gthumb_CFLAGS = \
$(GTHUMB_CFLAGS) \
$(EXIV2_CFLAGS) \
$(JPEG_CFLAGS) \
$(TIFF_CFLAGS) \
$(CLUTTER_CFLAGS) \
$(GNOME_KEYRING_CFLAGS) \
$(GSTREAMER_CFLAGS) \
$(LIBBRASERO_CFLAGS) \
$(LIBOPENRAW_CFLAGS) \
$(LIBSOUP_CFLAGS) \
-I$(top_srcdir)/copy-n-paste/ \
-DGTHUMB_LOCALEDIR=\"$(datadir)/locale\" \
-DGTHUMB_PREFIX=\"$(prefix)\" \
......
......@@ -62,16 +62,6 @@ get_idx_from_size (gint size)
}
static void
destroy_cb (GtkWidget *widget,
DialogData *data)
{
gth_browser_set_dialog (data->browser, "preferences", NULL);
g_object_unref (data->builder);
g_free (data);
}
static void
apply_changes (DialogData *data)
{
......@@ -94,11 +84,21 @@ apply_changes (DialogData *data)
}
static void
destroy_cb (GtkWidget *widget,
DialogData *data)
{
apply_changes (data);
gth_browser_set_dialog (data->browser, "preferences", NULL);
g_object_unref (data->builder);
g_free (data);
}
static void
close_button_clicked_cb (GtkWidget *widget,
DialogData *data)
{
apply_changes (data);
gtk_widget_destroy (data->dialog);
}
......
......@@ -400,14 +400,13 @@ eel_gconf_set_string_list (const char *key,
const GSList *slist)
{
GConfClient *client;
GError *error;
GError *error = NULL;
g_return_if_fail (key != NULL);
client = eel_gconf_client_get_global ();
g_return_if_fail (client != NULL);
error = NULL;
gconf_client_set_list (client, key, GCONF_VALUE_STRING,
/* Need cast cause of GConf api bug */
(GSList *) slist,
......@@ -419,16 +418,15 @@ eel_gconf_set_string_list (const char *key,
GSList *
eel_gconf_get_string_list (const char *key)
{
GSList *slist;
GSList *slist;
GConfClient *client;
GError *error;
GError *error = NULL;
g_return_val_if_fail (key != NULL, NULL);
client = eel_gconf_client_get_global ();
g_return_val_if_fail (client != NULL, NULL);
error = NULL;
slist = gconf_client_get_list (client, key, GCONF_VALUE_STRING, &error);
if (eel_gconf_handle_error (&error)) {
slist = NULL;
......
......@@ -757,12 +757,12 @@ _gth_browser_add_to_history (GthBrowser *browser,
GList *scan;
/* remove all the occurrences of file from the history */
for (scan = browser->priv->history_current; scan; /* void */) {
for (scan = browser->priv->history; scan; /* void */) {
GList *next = scan->next;
GFile *file_in_history = scan->data;
if (g_file_equal (file, file_in_history)) {
browser->priv->history_current = g_list_remove_link (browser->priv->history_current, scan);
if (_g_file_equal_uris (file, file_in_history)) {
browser->priv->history = g_list_remove_link (browser->priv->history, scan);
_g_object_list_unref (scan);
}
......@@ -1409,6 +1409,10 @@ _gth_browser_get_visible_folders (GthBrowser *browser,
}
static void _gth_browser_make_file_visible (GthBrowser *browser,
GthFileData *file_data);
static void
load_data_continue (LoadData *load_data,
GList *loaded_files)
......@@ -1454,8 +1458,9 @@ load_data_continue (LoadData *load_data,
case GTH_ACTION_VIEW:
case GTH_ACTION_LIST_CHILDREN:
if (path != NULL) {
GList *entry_points;
GList *scan;
GList *entry_points;
GList *scan;
gboolean is_entry_point = FALSE;
/* expand the path if it's an entry point */
......@@ -1465,12 +1470,18 @@ load_data_continue (LoadData *load_data,
if (g_file_equal (file_data->file, load_data->requested_folder->file)) {
gtk_tree_view_expand_row (GTK_TREE_VIEW (browser->priv->folder_tree), path, FALSE);
is_entry_point = TRUE;
break;
}
}
if (load_data->action != GTH_ACTION_LIST_CHILDREN) {
gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (browser->priv->folder_tree), path, NULL, FALSE, 0.0, 0.0);
gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (browser->priv->folder_tree),
path,
NULL,
is_entry_point,
0.0,
0.0);
gth_folder_tree_select_path (GTH_FOLDER_TREE (browser->priv->folder_tree), path);
}
......@@ -1520,6 +1531,16 @@ load_data_continue (LoadData *load_data,
browser->priv->monitor_location,
TRUE);
if (browser->priv->current_file != NULL) {
gth_browser_update_title (browser);
gth_browser_update_statusbar_file_info (browser);
if (gth_window_get_current_page (GTH_WINDOW (browser)) == GTH_BROWSER_PAGE_VIEWER) {
_gth_browser_make_file_visible (browser, browser->priv->current_file);
if (browser->priv->viewer_page != NULL)
gth_viewer_page_focus (browser->priv->viewer_page);
}
}
if (StartSlideshow) {
StartSlideshow = FALSE;
gth_hook_invoke ("slideshow", browser);
......@@ -1930,6 +1951,21 @@ _gth_browser_ask_whether_to_save (GthBrowser *browser,
/* -- _gth_browser_close -- */
static void
_gth_browser_deactivate_viewer_page (GthBrowser *browser)
{
if (browser->priv->viewer_page != NULL) {
if (browser->priv->fullscreen)
gth_viewer_page_show_pointer (GTH_VIEWER_PAGE (browser->priv->viewer_page), TRUE);
gth_viewer_page_deactivate (browser->priv->viewer_page);
gtk_ui_manager_ensure_update (browser->priv->ui);
gth_browser_set_viewer_widget (browser, NULL);
g_object_unref (browser->priv->viewer_page);
browser->priv->viewer_page = NULL;
}
}
static void
_gth_browser_close_final_step (gpointer user_data)
{
......@@ -1983,6 +2019,8 @@ _gth_browser_close_final_step (gpointer user_data)
/**/
_gth_browser_deactivate_viewer_page (browser);
gth_hook_invoke ("gth-browser-close", browser);
if (gtk_widget_get_realized (GTK_WIDGET (browser)) && last_window) {
......@@ -2164,10 +2202,6 @@ _gth_browser_update_browser_ui (GthBrowser *browser,
/* --- _gth_browser_set_current_page --- */
static void _gth_browser_make_file_visible (GthBrowser *browser,
GthFileData *file_data);
static void
_gth_browser_real_set_current_page (GthWindow *window,
int page)
......@@ -2192,12 +2226,16 @@ _gth_browser_real_set_current_page (GthWindow *window,
_gth_browser_hide_infobar (browser);
if (prev_page == GTH_BROWSER_PAGE_BROWSER) {
GdkWindowState state;
GdkWindow *gdk_win;
state = gdk_window_get_state (gtk_widget_get_window (GTK_WIDGET (browser)));
if ((state & GDK_WINDOW_STATE_MAXIMIZED) == 0) { /* ! maximized */
gtk_window_get_size (GTK_WINDOW (window), &width, &height);
gth_window_save_page_size (GTH_WINDOW (window), prev_page, width, height);
gdk_win = gtk_widget_get_window (GTK_WIDGET (browser));
if (gdk_win != NULL) {
GdkWindowState state = gdk_window_get_state (gdk_win);
if ((state & GDK_WINDOW_STATE_MAXIMIZED) == 0) { /* ! maximized */
gtk_window_get_size (GTK_WINDOW (browser), &width, &height);
gth_window_save_page_size (GTH_WINDOW (browser), prev_page, width, height);
}
}
}
......@@ -2614,14 +2652,12 @@ folder_tree_rename_cb (GthFolderTree *folder_tree,
{
GFile *parent;
char *uri;
char *new_basename;
GFile *new_file;
GError *error = NULL;
parent = g_file_get_parent (file);
uri = g_file_get_uri (file);
new_basename = g_strconcat (new_name, _g_uri_get_file_extension (uri), NULL);
new_file = g_file_get_child_for_display_name (parent, new_basename, &error);
new_file = g_file_get_child_for_display_name (parent, new_name, &error);
if (new_file == NULL)
_gtk_error_dialog_from_gerror_show (GTK_WINDOW (browser), _("Could not change name"), &error);
......@@ -2633,7 +2669,6 @@ folder_tree_rename_cb (GthFolderTree *folder_tree,
}
g_object_unref (new_file);
g_free (new_basename);
g_free (uri);
g_object_unref (parent);
}
......@@ -5057,21 +5092,6 @@ load_file_data_unref (LoadFileData *data)
}
static void
_gth_browser_deactivate_viewer_page (GthBrowser *browser)
{
if (browser->priv->viewer_page != NULL) {
if (browser->priv->fullscreen)
gth_viewer_page_show_pointer (GTH_VIEWER_PAGE (browser->priv->viewer_page), TRUE);
gth_viewer_page_deactivate (browser->priv->viewer_page);
gtk_ui_manager_ensure_update (browser->priv->ui);
gth_browser_set_viewer_widget (browser, NULL);
g_object_unref (browser->priv->viewer_page);
browser->priv->viewer_page = NULL;
}
}
static void
gth_viewer_page_file_loaded_cb (GthViewerPage *viewer_page,
GthFileData *file_data,
......
......@@ -205,8 +205,11 @@ void
gth_file_data_set_mime_type (GthFileData *self,
const char *mime_type)
{
if (mime_type != NULL)
if (mime_type != NULL) {
g_file_info_set_content_type (self->info, get_static_string (mime_type));
g_file_info_set_attribute_string (self->info, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, get_static_string (mime_type));
g_file_info_set_attribute_string (self->info, G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE, get_static_string (mime_type));
}
}
......
......@@ -100,15 +100,13 @@ _gth_icon_cache_get_icon_key (GIcon *icon)
file = g_file_icon_get_file (G_FILE_ICON (icon));
if (file != NULL) {
char *filename;
char *uri;
filename = g_file_get_path (file);
key = get_static_string (filename);
uri = g_file_get_uri (file);
key = get_static_string (uri);
g_free (filename);
g_free (uri);
}
g_object_unref (file);
}
return key;
......
......@@ -592,9 +592,6 @@ paint_background (GthImageSelector *self,
int n_rects;
int i;
cairo_save (cr);
gdk_cairo_region (cr, event->region);
cairo_clip (cr);
gdk_cairo_rectangle (cr, &self->priv->viewer->image_area);
cairo_clip (cr);
cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 0.5);
......@@ -606,7 +603,6 @@ paint_background (GthImageSelector *self,
cairo_rectangle (cr, paint_area.x, paint_area.y, paint_area.width, paint_area.height);
}
cairo_fill (cr);
cairo_restore (cr);
g_free (rects);
}
......@@ -641,8 +637,6 @@ paint_selection (GthImageSelector *self,
cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
#endif
gdk_cairo_region (cr, event->region);
gdk_cairo_rectangle (cr, &selection_area);
cairo_clip (cr);
......@@ -687,8 +681,8 @@ paint_selection (GthImageSelector *self,
cairo_rectangle (cr,
selection_area.x + 0.5,
selection_area.y + 0.5,
selection_area.width,
selection_area.height);
selection_area.width - 1,
selection_area.height - 1);
cairo_stroke (cr);
cairo_restore (cr);
......@@ -794,6 +788,7 @@ gth_image_selector_button_release (GthImageViewerTool *base,
update_cursor (self,
event->x + self->priv->viewer->x_offset,
event->y + self->priv->viewer->y_offset);
gtk_widget_queue_draw (GTK_WIDGET (self->priv->viewer));
return FALSE;
}
......@@ -966,6 +961,7 @@ gth_image_selector_button_press (GthImageViewerTool *base,
self->priv->viewer->pressed = TRUE;
self->priv->viewer->dragging = TRUE;
self->priv->drag_start_selection_area = self->priv->selection_area;
gtk_widget_queue_draw (GTK_WIDGET (self->priv->viewer));
retval = TRUE;
}
......
......@@ -46,6 +46,7 @@
* delay use this delay instead. */
#define STEP_INCREMENT 20.0 /* Scroll increment. */
enum {
CLICKED,
ZOOM_IN,
......@@ -114,6 +115,7 @@ struct _GthImageViewerPrivate {
gboolean skip_size_change;
gboolean reset_scrollbars;
guint update_adjustment_values;
GList *painters;
};
......@@ -398,6 +400,11 @@ gth_image_viewer_unrealize (GtkWidget *widget)
self->priv->cursor_void = NULL;
}
if (self->priv->update_adjustment_values != 0) {
g_source_remove (self->priv->update_adjustment_values);
self->priv->update_adjustment_values = 0;
}
gth_image_viewer_tool_unrealize (self->priv->tool);
GTK_WIDGET_CLASS (parent_class)->unrealize (widget);
......@@ -564,15 +571,15 @@ gth_image_viewer_size_allocate (GtkWidget *widget,
if (width > gdk_width)
self->x_offset = CLAMP (self->x_offset,
0,
width - gdk_width);
0,
width - gdk_width);
else
self->x_offset = 0;
if (height > gdk_height)
self->y_offset = CLAMP (self->y_offset,
0,
height - gdk_height);
0,
height - gdk_height);
else
self->y_offset = 0;
......@@ -583,40 +590,48 @@ gth_image_viewer_size_allocate (GtkWidget *widget,
/* Change adjustment values. */
gtk_adjustment_set_lower (self->hadj, 0.0);
gtk_adjustment_set_upper (self->hadj, width);
gtk_adjustment_set_value (self->hadj, self->x_offset);
gtk_adjustment_set_step_increment (self->hadj, STEP_INCREMENT);
gtk_adjustment_set_page_increment (self->hadj, gdk_width / 2);
gtk_adjustment_set_page_size (self->hadj, gdk_width);
gtk_adjustment_set_lower (self->vadj, 0.0);
gtk_adjustment_set_upper (self->vadj, height);
gtk_adjustment_set_value (self->vadj, self->y_offset);
gtk_adjustment_set_step_increment (self->vadj, STEP_INCREMENT);
gtk_adjustment_set_page_increment (self->vadj, gdk_height / 2);
gtk_adjustment_set_page_size (self->vadj, gdk_height);
gtk_adjustment_configure (self->hadj,
self->x_offset,
0.0,
width,
STEP_INCREMENT,
gdk_width / 2,
gdk_width);
gtk_adjustment_configure (self->vadj,
self->y_offset,
0.0,
height,
STEP_INCREMENT,
gdk_height / 2,
gdk_height);
}
else {
gtk_adjustment_set_lower (self->hadj, 0.0);
gtk_adjustment_set_upper (self->hadj, 1.0);
gtk_adjustment_set_value (self->hadj, 0.0);
gtk_adjustment_set_page_size (self->hadj, 1.0);
gtk_adjustment_set_lower (self->vadj, 0.0);
gtk_adjustment_set_upper (self->vadj, 1.0);
gtk_adjustment_set_value (self->vadj, 0.0);
gtk_adjustment_set_page_size (self->vadj, 1.0);
gtk_adjustment_configure (self->hadj,
0.0,
0.0,
1.0,
0.1,
1.0,
1.0);
gtk_adjustment_configure (self->vadj,
0.0,
0.0,
1.0,
0.1,
1.0,
1.0);
}
_gth_image_viewer_update_image_area (self);
/* FIXME
g_signal_handlers_block_by_data (G_OBJECT (self->hadj), self);
g_signal_handlers_block_by_data (G_OBJECT (self->vadj), self);
gtk_adjustment_changed (self->hadj);
gtk_adjustment_changed (self->vadj);
g_signal_handlers_unblock_by_data (G_OBJECT (self->hadj), self);
g_signal_handlers_unblock_by_data (G_OBJECT (self->vadj), self);
*/
/**/
......@@ -734,7 +749,6 @@ gth_image_viewer_expose (GtkWidget *widget,
self = GTH_IMAGE_VIEWER (widget);
cr = gdk_cairo_create (gtk_widget_get_window (widget));
cairo_set_line_width (cr, 0.5);
cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
......@@ -1573,13 +1587,14 @@ gth_image_viewer_instance_init (GthImageViewer *self)
self->priv->cursor_void = NULL;
self->priv->reset_scrollbars = TRUE;
self->priv->update_adjustment_values = 0;
self->priv->tool = gth_image_dragger_new (self);
/* Create the widget. */
self->hadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 1.0, 0.0, 1.0, 1.0, 1.0));
self->vadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 1.0, 0.0, 1.0, 1.0, 1.0));
self->hadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 1.0, 0.0, 0.1, 1.0, 1.0));
self->vadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 1.0, 0.0, 0.1, 1.0, 1.0));
g_object_ref (self->hadj);
g_object_ref_sink (self->hadj);
......@@ -2212,6 +2227,25 @@ gth_image_viewer_set_tool (GthImageViewer *self,
}
static gboolean
update_adjustment_values_cb (gpointer user_data)
{
GthImageViewer *self = user_data;
g_source_remove (self->priv->update_adjustment_values);
self->priv->update_adjustment_values = 0;
g_signal_handlers_block_by_data (G_OBJECT (self->hadj), self);
g_signal_handlers_block_by_data (G_OBJECT (self->vadj), self);
gtk_adjustment_set_value (self->hadj, self->x_offset);
gtk_adjustment_set_value (self->vadj, self->y_offset);
g_signal_handlers_unblock_by_data (G_OBJECT (self->hadj), self);
g_signal_handlers_unblock_by_data (G_OBJECT (self->vadj), self);
return FALSE;
}
void
gth_image_viewer_scroll_to (GthImageViewer *self,
int x_offset,
......@@ -2224,12 +2258,9 @@ gth_image_viewer_scroll_to (GthImageViewer *self,
scroll_to (self, &x_offset, &y_offset);
g_signal_handlers_block_by_data (G_OBJECT (self->hadj), self);
g_signal_handlers_block_by_data (G_OBJECT (self->vadj), self);
gtk_adjustment_set_value (self->hadj, self->x_offset);
gtk_adjustment_set_value (self->vadj, self->y_offset);
g_signal_handlers_unblock_by_data (G_OBJECT (self->hadj), self);
g_signal_handlers_unblock_by_data (G_OBJECT (self->vadj), self);
if (self->priv->update_adjustment_values != 0)
g_source_remove (self->priv->update_adjustment_values);
self->priv->update_adjustment_values = g_timeout_add (10, update_adjustment_values_cb, self);
}
......@@ -2474,8 +2505,7 @@ gth_image_viewer_paint_region (GthImageViewer *self,
int i;
cairo_save (cr);
gdk_cairo_region (cr, region);
cairo_clip (cr);
gdk_cairo_rectangle (cr, pixbuf_area);
cairo_clip (cr);