Xfce Forum

Sub domains
 

You are not logged in.

#1 2014-02-24 13:12:55

crysman
Member
Registered: 2014-02-24
Posts: 2

is ristretto "save copy..." feature lossless?

Just a simple question from the title: is ristretto "save copy..." feature lossless?.
I mean if it saves a new jpeg file (that would mean a lossy save) or if it just copies the existing file (that of course would be lossless).
Thanks

Offline

#2 2014-02-24 14:30:26

ToZ
Moderator
From: Toronto, Canada
Registered: 2011-06-02
Posts: 1,173

Re: is ristretto "save copy..." feature lossless?

Looks like it just copies the file. From http://git.xfce.org/apps/ristretto/tree … n_window.c (uses g_copy_file):

/**
 * cb_rstto_main_window_save_copy:
 * @widget:
 * @window:
 *
 *
 */
static void
cb_rstto_main_window_save_copy (GtkWidget *widget, RsttoMainWindow *window)
{
    GtkWidget *dialog, *err_dialog;
    gint response;
    GFile *file, *s_file;

    dialog = gtk_file_chooser_dialog_new(_("Save copy"),
                                         GTK_WINDOW(window),
                                         GTK_FILE_CHOOSER_ACTION_SAVE,
                                         GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                                         GTK_STOCK_SAVE, GTK_RESPONSE_OK,
                                         NULL);
    gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE);

    response = gtk_dialog_run(GTK_DIALOG(dialog));
    if(response == GTK_RESPONSE_OK)
    {
        file = gtk_file_chooser_get_file (GTK_FILE_CHOOSER (dialog));
        s_file = rstto_file_get_file(rstto_image_list_iter_get_file (window->priv->iter));
        if ( FALSE == g_file_copy (
                s_file,
                file,
                G_FILE_COPY_OVERWRITE,
                NULL,
                NULL,
                NULL,
                NULL) )
        {
            err_dialog = gtk_message_dialog_new(GTK_WINDOW(window),
                                            GTK_DIALOG_MODAL,
                                            GTK_MESSAGE_ERROR,
                                            GTK_BUTTONS_OK,
                                            _("Could not save file"));
            gtk_dialog_run(GTK_DIALOG(err_dialog));
            gtk_widget_destroy(err_dialog);
        }
    }

    gtk_widget_destroy(dialog);

}

In addition, after the file save, both files are the same size and identical (using ImageMagik's compare utility)

Offline

#3 2014-02-24 14:45:06

crysman
Member
Registered: 2014-02-24
Posts: 2

Re: is ristretto "save copy..." feature lossless?

Thanks for the quick and complete reply!

I would then suggest to put it there in the name - so users hadn't any doubts. I mean instead of just "save copy..." we could use "save copy... (lossless)".

I've also submitted a "save copy" improvement request on launchpad:
https://bugs.launchpad.net/ubuntu/+sour … ug/1284111

(just for info)

Thanks again

Offline

Board footer

Powered by FluxBB