Commit 2a47f098 authored by Sven Neumann's avatar Sven Neumann
Browse files

applied a (modified) patch from Rene Rebe <rene.rebe@okay.net> that allows

        * app/fileops.c:
        applied a (modified) patch from Rene Rebe <rene.rebe@okay.net>
        that allows to generate previews for multiple files. Plugged
        some small memleaks while I was on it.

        * tools/pdbgen/pdb/gimage.pdb
        * app/gimage_cmds.c
        * app/xcf.c: plugged memleaks that occured on xcf and indexed load

        * po/fr.po: applied a patch from Daniel Eggert that fixes a merging
        problem in the french translation

--Sven
parent 71eb0766
Tue Nov 9 15:08:13 MET 1999 Sven Neumann <sven@gimp.org>
* app/fileops.c:
applied a (modified) patch from Rene Rebe <rene.rebe@okay.net>
that allows to generate previews for multiple files. Plugged
some small memleaks while I was on it.
* tools/pdbgen/pdb/gimage.pdb
* app/gimage_cmds.c
* app/xcf.c: plugged memleaks that occured on xcf and indexed load
* po/fr.po: applied a patch from Daniel Eggert that fixes a merging
problem in the french translation
Tue Nov 9 05:14:41 GMT 1999 Nick Lamb <njl195@zepler.org>
* plug-ins/common/png.c: Option to reduce file size further
......
......@@ -338,7 +338,7 @@ file_open_callback (GtkWidget *widget,
gtk_signal_connect (GTK_OBJECT (open_options_genbutton),
"clicked",
(GtkSignalFunc) genbutton_callback,
open_options_genbutton);
fileload);
gtk_box_pack_end (GTK_BOX (hbox), open_options_genbutton,
TRUE, FALSE, 0);
}
......@@ -1165,7 +1165,7 @@ set_preview (const gchar *fullfname,
gchar *pname;
gchar *fname;
gchar *tname;
gchar *imginfo;
gchar *imginfo = NULL;
struct stat file_stat;
struct stat thumb_stat;
gboolean thumb_may_be_outdated = FALSE;
......@@ -1250,6 +1250,8 @@ set_preview (const gchar *fullfname,
thumb_may_be_outdated ?
_("(this thumbnail may be out of date)") :
(imginfo ? imginfo : _("(no information)")));
if (imginfo)
g_free (imginfo);
}
else
{
......@@ -1315,13 +1317,26 @@ genbutton_callback (GtkWidget *widget,
{
GimpImage* gimage_to_be_thumbed;
gchar* filename;
guchar* RGBbuf;
TempBuf* tempbuf;
gint RGBbuf_w;
gint RGBbuf_h;
/* added for multi-file preview generation... */
GtkFileSelection *fs;
gchar* mfilename = NULL;
gchar* filedirname;
struct stat buf;
int err;
fs = GTK_FILE_SELECTION (data);
if (!preview_fullname)
{
g_warning ("Tried to generate thumbnail for NULL filename.");
return;
}
filename = g_strdup (preview_fullname);
gimp_add_busy_cursors ();
......@@ -1330,9 +1345,6 @@ genbutton_callback (GtkWidget *widget,
g_basename(filename),
RUN_NONINTERACTIVE)))
{
guchar* RGBbuf;
gint RGBbuf_w, RGBbuf_h;
TempBuf* tempbuf;
tempbuf = make_thumb_tempbuf (gimage_to_be_thumbed);
RGBbuf = make_RGBbuf_from_tempbuf (tempbuf, &RGBbuf_w, &RGBbuf_h);
......@@ -1356,9 +1368,95 @@ genbutton_callback (GtkWidget *widget,
_("(could not make preview)"));
}
/* new mult-file preview make: */
{
GList *row = GTK_CLIST(fs->file_list)->row_list;
gint rownum = 0;
gchar* temp;
/*printf("%d\n", GTK_CLIST(fs->file_list)->rows);*/
filedirname = g_dirname (filename);
while (row)
{
if (GTK_CLIST_ROW(row)->state == GTK_STATE_SELECTED)
{
if (gtk_clist_get_cell_type(GTK_CLIST(fs->file_list),
rownum, 0) == GTK_CELL_TEXT)
{
gtk_clist_get_text (GTK_CLIST(fs->file_list),
rownum, 0, &temp);
mfilename = g_strdup (temp);
err = stat (mfilename, &buf);
if (! (err == 0 && (buf.st_mode & S_IFDIR)))
{ /* Is not directory. */
if (err)
{
g_free (mfilename);
mfilename = g_strconcat (filedirname,
G_DIR_SEPARATOR_S,
temp, NULL);
}
/* When doing multiple selections, the name
* of the first item touched with the cursor will
* become the text-field default - and we don't
* want to load that twice.
*/
if (strcmp (mfilename, filename) == 0)
{
goto next_iter;
}
if ((gimage_to_be_thumbed = file_open_image (mfilename,
temp,
RUN_NONINTERACTIVE)))
{
tempbuf = make_thumb_tempbuf (gimage_to_be_thumbed);
RGBbuf = make_RGBbuf_from_tempbuf (tempbuf, &RGBbuf_w, &RGBbuf_h);
switch (thumbnail_mode)
{
case 0:
break;
default:
file_save_thumbnail (gimage_to_be_thumbed, mfilename, tempbuf);
}
set_preview (mfilename, RGBbuf, RGBbuf_w, RGBbuf_h);
gimage_delete (gimage_to_be_thumbed);
if (RGBbuf)
g_free (RGBbuf);
}
else
{
gtk_label_set_text (GTK_LABEL(open_options_label),
_("(could not make preview)"));
}
}
}
}
next_iter:
if (mfilename)
{
g_free (mfilename);
mfilename = NULL;
}
rownum++;
row = g_list_next (row);
}
}
gtk_widget_set_sensitive (GTK_WIDGET (fileload), TRUE);
gimp_remove_busy_cursors (NULL);
if (filedirname)
g_free (filedirname);
g_free (filename);
}
......@@ -1367,8 +1465,10 @@ file_open_ok_callback (GtkWidget *widget,
gpointer data)
{
GtkFileSelection *fs;
char* filename, *raw_filename, *mfilename;
gchar* filedirname;
gchar *filename;
gchar *raw_filename;
gchar *mfilename = NULL;
gchar *filedirname;
struct stat buf;
int err;
GString *s;
......@@ -1447,8 +1547,6 @@ file_open_ok_callback (GtkWidget *widget,
gint rownum = 0;
gchar* temp;
/*printf("%d\n", GTK_CLIST(fs->file_list)->rows);*/
while (row)
{
if (GTK_CLIST_ROW(row)->state == GTK_STATE_SELECTED)
......@@ -1459,15 +1557,11 @@ file_open_ok_callback (GtkWidget *widget,
gtk_clist_get_text (GTK_CLIST(fs->file_list),
rownum, 0, &temp);
/*printf("%s\n", temp);*/
/* When doing multiple selections, the name
* of the first item touched with the cursor will
* become the text-field default - and we don't
* want to load that twice.
*/
/*printf("[%s]{%s}\n", temp, raw_filename);*/
/* fflush(stdout);*/
if (strcmp(temp, raw_filename)==0)
{
goto next_iter;
......@@ -1486,9 +1580,6 @@ file_open_ok_callback (GtkWidget *widget,
mfilename = g_strconcat (filedirname,
G_DIR_SEPARATOR_S,
temp, NULL);
/*printf(">>> %s\n", mfilename);*/
/*fflush (stdout);*/
}
if (file_open (mfilename, temp))
......@@ -1504,28 +1595,22 @@ file_open_ok_callback (GtkWidget *widget,
g_string_free (s, TRUE);
}
}
if (mfilename)
{
g_free (mfilename);
mfilename = NULL;
}
}
}
next_iter:
if (mfilename)
{
g_free (mfilename);
mfilename = NULL;
}
rownum++;
row = g_list_next (row);
}
/*fflush(stdout);*/
}
if (filedirname)
{
g_free (filedirname);
filedirname = NULL;
}
g_free (filedirname);
}
static void
......
......@@ -1856,7 +1856,7 @@ image_set_cmap_invoker (Argument *args)
if (success)
{
if (gimage->num_cols && gimage->cmap)
if (gimage->cmap)
{
g_free (gimage->cmap);
gimage->cmap = NULL;
......
......@@ -2159,11 +2159,9 @@ xcf_load_layer (XcfInfo *info,
/* create a new layer */
layer = layer_new (gimage, width, height, type, name, 255, NORMAL_MODE);
g_free (name);
if (!layer)
{
g_free (name);
return NULL;
}
return NULL;
/* read in the layer properties */
if (!xcf_load_layer_props (info, gimage, layer))
......@@ -2243,11 +2241,9 @@ xcf_load_channel (XcfInfo *info,
/* create a new channel */
channel = channel_new (gimage, width, height, name, 255, color);
g_free (name);
if (!channel)
{
g_free (name);
return NULL;
}
return NULL;
/* read in the channel properties */
if (!xcf_load_channel_props (info, gimage, channel))
......@@ -2302,11 +2298,9 @@ xcf_load_layer_mask (XcfInfo *info,
/* create a new layer mask */
layer_mask = layer_mask_new (gimage, width, height, name, 255, color);
g_free (name);
if (!layer_mask)
{
g_free (name);
return NULL;
}
return NULL;
/* read in the layer_mask properties */
if (!xcf_load_channel_props (info, gimage, GIMP_CHANNEL(layer_mask)))
......
......@@ -2159,11 +2159,9 @@ xcf_load_layer (XcfInfo *info,
/* create a new layer */
layer = layer_new (gimage, width, height, type, name, 255, NORMAL_MODE);
g_free (name);
if (!layer)
{
g_free (name);
return NULL;
}
return NULL;
/* read in the layer properties */
if (!xcf_load_layer_props (info, gimage, layer))
......@@ -2243,11 +2241,9 @@ xcf_load_channel (XcfInfo *info,
/* create a new channel */
channel = channel_new (gimage, width, height, name, 255, color);
g_free (name);
if (!channel)
{
g_free (name);
return NULL;
}
return NULL;
/* read in the channel properties */
if (!xcf_load_channel_props (info, gimage, channel))
......@@ -2302,11 +2298,9 @@ xcf_load_layer_mask (XcfInfo *info,
/* create a new layer mask */
layer_mask = layer_mask_new (gimage, width, height, name, 255, color);
g_free (name);
if (!layer_mask)
{
g_free (name);
return NULL;
}
return NULL;
/* read in the layer_mask properties */
if (!xcf_load_channel_props (info, gimage, GIMP_CHANNEL(layer_mask)))
......
......@@ -2,13 +2,14 @@
# Copyright (C) 1998 Free Software Foundation, Inc.
# Vincent Renardias <vincent@ldsol.com>, 1998, 1999.
# David Monniaux <monniaux@brick.ens.fr>, 1999.
# Daniel Egger <Daniel.Egger@rz.fh-muenchen.de>, 1999.
#
msgid ""
msgstr ""
"Project-Id-Version: gimp 1.1.9\n"
"Project-Id-Version: gimp 1.1.11\n"
"POT-Creation-Date: 1999-10-06 13:09-0700\n"
"PO-Revision-Date: 1999-03-18 19:00+0100\n"
"Last-Translator: David Monniaux <David.Monniaux@ens.fr>\n"
"PO-Revision-Date: 1999-11-05 15:37+0100\n"
"Last-Translator: Daniel Egger <Daniel.Egger@rz.fh-muenchen.de>\n"
"Language-Team: GNOME French Team <gnomefr@gnomefr.traduc.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
......@@ -6299,184 +6300,9 @@ msgstr "Votre image devrait
#. the footline
#: libgimp/gimpexport.c:332
msgid "The export conversion won't modify your original image."
msgstr "La conversion de sortie ne modifiera pas votr image originale."
msgstr "La conversion de sortie ne modifiera pas votre image originale."
#~ msgid "Cannot properly scanline convert polygon!\n"
#~ msgstr ""
#~ "Je n'arrive pas convertir le polygone en lignes horizontales de trame.\n"
#~ msgid "/Image/Channel Ops/Offset"
#~ msgstr "/Image/Canaux/Dcalage"
#~ msgid "raise layer"
#~ msgstr "lever calque"
#~ msgid "lower layer"
#~ msgstr "abaisser calque"
#~ msgid "raise layer to top"
#~ msgstr "lever le calque tout en haut"
#~ msgid "lower layer to bottom"
#~ msgstr "abaisser le calque tout en bas"
#~ msgid "re-position layer"
#~ msgstr "re-positionner le calque"
#~ msgid "/File/Acquire"
#~ msgstr "/Fichier/Acquisition"
#~ msgid "/View/Window Info..."
#~ msgstr "/Vue/Information sur la Fentre..."
#~ msgid "/Script-Fu/"
#~ msgstr "/Script-Fu/"
#: libgimp/gimpexport.c:89
msgid "can't handle layers"
msgstr "Je ne peux grer les calques."
#: libgimp/gimpexport.c:90 libgimp/gimpexport.c:99
msgid "Merge visible layers"
msgstr "Fusionner les calques visibles"
#: libgimp/gimpexport.c:98
msgid "can only handle layers as animation frames"
msgstr "Je ne gre les calques qu'en tant qu'images d'une animation."
#: libgimp/gimpexport.c:99
msgid "Save as animation"
msgstr "Sauver comme annimation"
#: libgimp/gimpexport.c:107
#, fuzzy
msgid "can't handle transparency"
msgstr "Gomme (met la couleur de fond ou rend transparent)"
#: libgimp/gimpexport.c:108
#, fuzzy
msgid "Flatten Image"
msgstr "/Aplatir l'image"
#: libgimp/gimpexport.c:116
msgid "can only handle RGB images"
msgstr "je ne gre que les images RVB"
#: libgimp/gimpexport.c:117 libgimp/gimpexport.c:144 libgimp/gimpexport.c:153
msgid "Convert to RGB"
msgstr "Convertir en RVB"
#: libgimp/gimpexport.c:125
msgid "can only handle grayscale images"
msgstr "je ne gre que les images en tons de gris"
#: libgimp/gimpexport.c:126 libgimp/gimpexport.c:144 libgimp/gimpexport.c:163
msgid "Convert to grayscale"
msgstr "Convertir en niveaux de gris"
#: libgimp/gimpexport.c:134
#, fuzzy
msgid "can only handle indexed images"
msgstr "je ne gre que les images indexes."
#: libgimp/gimpexport.c:135 libgimp/gimpexport.c:153 libgimp/gimpexport.c:162
msgid ""
"Convert to indexed using default settings\n"
"(Do it manually to tune the result)"
msgstr ""
"Convertir en couleurs indexes avec les rglages par dfaut\n"
"(faites-le manuellement pour rgler le rsultat)"
#: libgimp/gimpexport.c:143
msgid "can only handle RGB or grayscale images"
msgstr "je ne gre que les images RVB ou en tons de gris"
#: libgimp/gimpexport.c:152
msgid "can only handle RGB or indexed images"
msgstr "je ne gre que les images RVB ou indexes"
#: libgimp/gimpexport.c:161
msgid "can only handle grayscale or indexed images"
msgstr "je ne gre que les images en tons de gris ou indexes"
#: libgimp/gimpexport.c:233
msgid "Export File"
msgstr "Exporter chemin"
#: libgimp/gimpexport.c:249
msgid "Export"
msgstr "Exporter"
#: libgimp/gimpexport.c:274
msgid ""
"Your image should be exported before it can be saved for the following "
"reasons:"
msgstr ""
"Votre image devrait tre exporte avant d'tre enregistre pour les\n"
"raison suivantes:"
#. the footline
#: libgimp/gimpexport.c:332
msgid "The export conversion won't modify your original image."
msgstr ""
#~ msgid "Cannot properly scanline convert polygon!\n"
#~ msgstr ""
#~ "Je n'arrive pas convertir le polygone en lignes horizontales de trame.\n"
#~ msgid "/Image/Channel Ops/Offset"
#~ msgstr "/Image/Canaux/Dcalage"
#~ msgid "Gamma"
#~ msgstr "Gamma"
#~ msgid "Gamma:"
#~ msgstr "Gamma:"
#~ msgid "raise layer"
#~ msgstr "lever calque"
#~ msgid "lower layer"
#~ msgstr "abaisser calque"
#~ msgid "raise layer to top"
#~ msgstr "lever le calque tout en haut"
#~ msgid "lower layer to bottom"
#~ msgstr "abaisser le calque tout en bas"
#~ msgid "re-position layer"
#~ msgstr "re-positionner le calque"
#~ msgid "Curve"
#~ msgstr "Courbe"
#~ msgid "Edge Detect "
#~ msgstr "Dtection de contour"
#~ msgid "Elasticity:"
#~ msgstr "lasticit:"
#~ msgid "/File/Acquire"
#~ msgstr "/Fichier/Acquisition"
#~ msgid "/View/Window Info..."
#~ msgstr "/Vue/Information sur la Fentre..."
#~ msgid "/Script-Fu/"
#~ msgstr "/Script-Fu/"
#~ msgid "<< Undo"
#~ msgstr "<< Dfaire"
#~ msgid "Redo >>"
#~ msgstr "Refaire >>"
#~ msgid "GIMP Message"
#~ msgstr "Message GIMP"
#~ msgid "Length:"
#~ msgstr "Longueur:"
#~ msgid "File Previews / Thumbnails"
#~ msgstr "Aperus des fichiers / Icnes"
......@@ -800,7 +800,7 @@ HELP
headers => [ qw("gdisplay.h") ],
code => <<'CODE'
{
if (gimage->num_cols && gimage->cmap)
if (gimage->cmap)
{
g_free (gimage->cmap);
gimage->cmap = NULL;
......
......@@ -800,7 +800,7 @@ HELP
headers => [ qw("gdisplay.h") ],
code => <<'CODE'
{
if (gimage->num_cols && gimage->cmap)
if (gimage->cmap)
{
g_free (gimage->cmap);
gimage->cmap = NULL;
......
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