~ubuntu-branches/ubuntu/vivid/gimp/vivid

« back to all changes in this revision

Viewing changes to plug-ins/file-ico/ico-save.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach
  • Date: 2012-05-08 18:50:03 UTC
  • mto: (1.1.26) (0.5.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 71.
  • Revision ID: package-import@ubuntu.com-20120508185003-tltkvbaysf8d2426
ImportĀ upstreamĀ versionĀ 2.8.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 * GIMP Plug-in for Windows Icon files.
5
5
 * Copyright (C) 2002 Christian Kreibich <christian@whoop.org>.
6
6
 *
7
 
 * This program is free software; you can redistribute it and/or modify
 
7
 * This program is free software: you can redistribute it and/or modify
8
8
 * it under the terms of the GNU General Public License as published by
9
 
 * the Free Software Foundation; either version 2 of the License, or
 
9
 * the Free Software Foundation; either version 3 of the License, or
10
10
 * (at your option) any later version.
11
11
 *
12
12
 * This program is distributed in the hope that it will be useful,
15
15
 * GNU General Public License for more details.
16
16
 *
17
17
 * You should have received a copy of the GNU General Public License
18
 
 * along with this program; if not, write to the Free Software
19
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
19
 */
21
20
 
22
21
#include "config.h"
557
556
 
558
557
  if (bpp <= 8 || bpp == 24 || drawable->bpp != 4)
559
558
    {
560
 
      gint32        image = gimp_drawable_get_image (layer);
 
559
      gint32        image = gimp_item_get_image (layer);
561
560
      GimpDrawable *tmp;
562
561
 
563
562
      tmp_image = gimp_image_new (gimp_drawable_width (layer),
578
577
      tmp_layer = gimp_layer_new (tmp_image, "tmp", w, h,
579
578
                                  gimp_drawable_type (layer),
580
579
                                  100, GIMP_NORMAL_MODE);
581
 
      gimp_image_add_layer (tmp_image, tmp_layer, 0);
 
580
      gimp_image_insert_layer (tmp_image, tmp_layer, -1, 0);
582
581
 
583
582
      tmp = gimp_drawable_get (tmp_layer);
584
583
 
1026
1025
  if (fwrite (entries, sizeof (IcoFileEntry), info.num_icons, fp) <= 0)
1027
1026
    {
1028
1027
      ico_save_info_free (&info);
 
1028
      g_free (entries);
1029
1029
      fclose (fp);
1030
1030
      return GIMP_PDB_EXECUTION_ERROR;
1031
1031
    }
1090
1090
 
1091
1091
  ico_save_info_free (&info);
1092
1092
  fclose (fp);
 
1093
  g_free (entries);
1093
1094
 
1094
1095
  return GIMP_PDB_SUCCESS;
1095
1096
}