~ubuntu-branches/ubuntu/saucy/gimp/saucy-updates

« back to all changes in this revision

Viewing changes to plug-ins/common/file-gif-save.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-08 13:26:03 UTC
  • mfrom: (1.1.28) (0.4.19 sid)
  • Revision ID: package-import@ubuntu.com-20130308132603-h14fmrgazi3roobr
Tags: 2.8.4-1ubuntu1
* Synchronize with Debian (LP: #1132767). Remaining changes:
  - debian/patches/02_help-message.patch,
    debian/patches/03_gimp.desktop.in.in.patch:
    + Update some strings for Ubuntu
  - debian/control:
    + Update description
  - debian/rules:
    + Set gettext domain and update translation templates
* Dropped changes:
  - CVE-2012-5576.patch: Applied in new version
  - fix-python-multiarch-includes.patch: No longer needed
* debian/patches/link-against-lm.patch:
  - Link against lm to fix underlinking build failure
* debian/control, debian/rules:
  - Run autoreconf for above patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
104
104
                                        GError          **error);
105
105
 
106
106
static GimpPDBStatusType sanity_check  (const gchar      *filename,
107
 
                                        gint32            image_ID,
 
107
                                        gint32           *image_ID,
108
108
                                        GError          **error);
109
109
static gboolean bad_bounds_dialog      (void);
110
110
 
209
209
  if (strcmp (name, SAVE_PROC) == 0)
210
210
    {
211
211
      const gchar *filename;
212
 
      gint32       image_ID;
 
212
      gint32       image_ID, sanitized_image_ID = 0;
213
213
      gint32       drawable_ID;
214
214
      gint32       orig_image_ID;
215
215
 
221
221
          run_mode == GIMP_RUN_WITH_LAST_VALS)
222
222
        gimp_ui_init (PLUG_IN_BINARY, FALSE);
223
223
 
224
 
      status = sanity_check (filename, image_ID, &error);
 
224
      status = sanity_check (filename, &image_ID, &error);
225
225
 
226
226
      /* Get the export options */
227
227
      if (status == GIMP_PDB_SUCCESS)
228
228
        {
 
229
          /* If the sanity check succeeded, the image_ID will point to
 
230
           * a duplicate image to delete later. */
 
231
          sanitized_image_ID = image_ID;
 
232
 
229
233
          switch (run_mode)
230
234
            {
231
235
            case GIMP_RUN_INTERACTIVE:
283
287
            if (export == GIMP_EXPORT_CANCEL)
284
288
              {
285
289
                values[0].data.d_status = GIMP_PDB_CANCEL;
 
290
                if (sanitized_image_ID)
 
291
                  gimp_image_delete (sanitized_image_ID);
286
292
                return;
287
293
              }
288
294
          }
305
311
            {
306
312
              status = GIMP_PDB_EXECUTION_ERROR;
307
313
            }
 
314
 
 
315
          gimp_image_delete (sanitized_image_ID);
308
316
        }
309
317
 
310
318
      if (export == GIMP_EXPORT_EXPORT)
565
573
 
566
574
static GimpPDBStatusType
567
575
sanity_check (const gchar  *filename,
568
 
              gint32        image_ID,
 
576
              gint32       *image_ID,
569
577
              GError      **error)
570
578
{
571
579
  gint32 *layers;
574
582
  gint    image_height;
575
583
  gint    i;
576
584
 
577
 
  image_width  = gimp_image_width (image_ID);
578
 
  image_height = gimp_image_height (image_ID);
 
585
  image_width  = gimp_image_width (*image_ID);
 
586
  image_height = gimp_image_height (*image_ID);
579
587
 
580
588
  if (image_width > G_MAXUSHORT || image_height > G_MAXUSHORT)
581
589
    {
591
599
  /*** Iterate through the layers to make sure they're all ***/
592
600
  /*** within the bounds of the image                      ***/
593
601
 
594
 
  layers = gimp_image_get_layers (image_ID, &nlayers);
 
602
  *image_ID = gimp_image_duplicate (*image_ID);
 
603
  layers = gimp_image_get_layers (*image_ID, &nlayers);
595
604
 
596
605
  for (i = 0; i < nlayers; i++)
597
606
    {
614
623
           */
615
624
          if ((run_mode == GIMP_RUN_NONINTERACTIVE) || bad_bounds_dialog ())
616
625
            {
617
 
              gimp_image_crop (image_ID, image_width, image_height, 0, 0);
 
626
              gimp_image_crop (*image_ID, image_width, image_height, 0, 0);
618
627
              return GIMP_PDB_SUCCESS;
619
628
            }
620
629
          else
621
630
            {
 
631
              gimp_image_delete (*image_ID);
622
632
              return GIMP_PDB_CANCEL;
623
633
            }
624
634
        }