~ubuntu-branches/ubuntu/wily/grass/wily

« back to all changes in this revision

Viewing changes to lib/pngdriver/write.c

Tags: 7.0.0~rc1+ds1-1~exp1
* New upstream release candidate.
* Repack upstream tarball, remove precompiled Python objects.
* Add upstream metadata.
* Update gbp.conf and Vcs-Git URL to use the experimental branch.
* Update watch file for GRASS 7.0.
* Drop build dependencies for Tcl/Tk, add build dependencies:
  python-numpy, libnetcdf-dev, netcdf-bin, libblas-dev, liblapack-dev
* Update Vcs-Browser URL to use cgit instead of gitweb.
* Update paths to use grass70.
* Add configure options: --with-netcdf, --with-blas, --with-lapack,
  remove --with-tcltk-includes.
* Update patches for GRASS 7.
* Update copyright file, changes:
  - Update copyright years
  - Group files by license
  - Remove unused license sections
* Add patches for various typos.
* Fix desktop file with patch instead of d/rules.
* Use minimal dh rules.
* Bump Standards-Version to 3.9.6, no changes.
* Use dpkg-maintscript-helper to replace directories with symlinks.
  (closes: #776349)
* Update my email to use @debian.org address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*!
 
2
  \file lib/pngdriver/write.c
 
3
 
 
4
  \brief GRASS png display driver - write image (lower level functions)
 
5
 
 
6
  (C) 2007-2014 by Glynn Clements and the GRASS Development Team
 
7
  
 
8
  This program is free software under the GNU General Public License
 
9
  (>=v2). Read the file COPYING that comes with GRASS for details.
 
10
  
 
11
  \author Glynn Clements
 
12
*/
1
13
 
2
14
#include <stdio.h>
3
15
#include <stdlib.h>
9
21
 
10
22
void write_image(void)
11
23
{
12
 
    char *p = file_name + strlen(file_name) - 4;
 
24
    char *p = png.file_name + strlen(png.file_name) - 4;
13
25
 
14
 
    if (!modified)
 
26
    if (!png.modified)
15
27
        return;
16
28
 
17
 
    if (mapped)
 
29
    if (png.mapped)
18
30
        return;
19
31
 
20
32
    if (G_strcasecmp(p, ".ppm") == 0) {
21
33
        write_ppm();
22
 
        if (has_alpha)
 
34
        if (png.has_alpha)
23
35
            write_pgm();
24
36
    }
25
37
    else if (G_strcasecmp(p, ".bmp") == 0)
31
43
    else
32
44
        G_fatal_error("write_image: unknown file type: %s", p);
33
45
 
34
 
    modified = 0;
 
46
    png.modified = 0;
35
47
}