[Git][debian-gis-team/libgeotiff][experimental] 9 commits: Revert "Update branch in gbp.conf & Vcs-Git URL."
Bas Couwenberg (@sebastic)
gitlab at salsa.debian.org
Tue Mar 8 16:49:15 GMT 2022
Bas Couwenberg pushed to branch experimental at Debian GIS Project / libgeotiff
Commits:
9626499d by Bas Couwenberg at 2021-08-15T10:39:08+02:00
Revert "Update branch in gbp.conf & Vcs-Git URL."
This reverts commit 692fab00a3cccef63d046364b9dbcab2cc694353.
- - - - -
b6e08e45 by Bas Couwenberg at 2021-08-15T10:40:21+02:00
Move from experimental to unstable.
- - - - -
072a7efb by Bas Couwenberg at 2021-09-08T16:35:47+02:00
Bump Standards-Version to 4.6.0, no changes.
- - - - -
6958203a by Bas Couwenberg at 2021-09-12T08:52:17+02:00
Bump debhelper compat to 12.
Changes:
- Drop --list-missing from dh_install
- - - - -
084ece93 by Bas Couwenberg at 2022-03-08T17:10:12+01:00
Update branch in gbp.conf & Vcs-Git URL.
- - - - -
cc54e3b3 by Bas Couwenberg at 2022-03-08T17:11:08+01:00
New upstream version 1.7.1~rc1
- - - - -
e384e96d by Bas Couwenberg at 2022-03-08T17:11:13+01:00
Update upstream source from tag 'upstream/1.7.1_rc1'
Update to upstream version '1.7.1~rc1'
with Debian dir c86c728ccbdda04ab24c19fdac8037635419daf6
- - - - -
24ac978c by Bas Couwenberg at 2022-03-08T17:11:59+01:00
New upstream release candidate.
- - - - -
6e0e6c39 by Bas Couwenberg at 2022-03-08T17:30:23+01:00
Set distribution to experimental.
- - - - -
19 changed files:
- CMakeLists.txt
- LICENSE
- Makefile.am
- NEWS
- bin/CMakeLists.txt
- bin/applygeo.c
- bin/geotifcp.c
- cmake/geo_config.h.in
- configure
- configure.ac
- cpl_serv.h
- debian/changelog
- − debian/compat
- debian/control
- debian/rules
- geo_config.h.in
- geo_new.c
- geo_normalize.c
- geotiff.h
Changes:
=====================================
CMakeLists.txt
=====================================
@@ -12,14 +12,14 @@ SET(GEOTIFF_LIBRARY_TARGET geotiff_library)
##############################################################################
# CMake settings
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
+CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0)
SET(CMAKE_COLOR_MAKEFILE ON)
# Version information
set(PROJECT_VERSION_MAJOR 1)
set(PROJECT_VERSION_MINOR 7)
-set(PROJECT_VERSION_PATCH 0)
+set(PROJECT_VERSION_PATCH 1)
set(PROJECT_VERSION
"${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
set(GeoTIFF_VERSION ${PROJECT_VERSION})
@@ -29,7 +29,7 @@ set(GeoTIFF_VERSION ${PROJECT_VERSION})
# libgeotiff.so.2 -> libgeotiff.so.2.2.0
# libgeotiff.so.2.2.0
set(LINK_SOVERSION "5")
-set(LINK_VERSION "5.1.0")
+set(LINK_VERSION "5.2.0")
string (TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
string (TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPER)
@@ -54,12 +54,6 @@ IF(CMAKE_BUILD_TYPE MATCHES Debug)
SET(GEOTIFF_BUILD_PEDANTIC TRUE)
ENDIF()
-if (CMAKE_MAJOR_VERSION GREATER 2)
-cmake_policy(SET CMP0022 OLD) # interface link libraries
-cmake_policy(SET CMP0042 OLD) # osx rpath
-endif()
-
-
# TODO: Still testing the output paths --mloskot
SET(GEOTIFF_BUILD_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
@@ -103,10 +97,7 @@ ENDIF()
# Check required standard headers
INCLUDE(CheckIncludeFiles)
-CHECK_INCLUDE_FILES(stdio.h HAVE_STDIO_H)
-CHECK_INCLUDE_FILES(stdlib.h HAVE_STDLIB_H)
-CHECK_INCLUDE_FILES(string.h HAVE_STRING_H)
-CHECK_INCLUDE_FILES(strings.h HAVE_STRINGS_H)
+CHECK_INCLUDE_FILES(strings.h GEOTIFF_HAVE_STRINGS_H)
###############################################################################
# User-defined build settings
@@ -246,23 +237,9 @@ SET(GEOTIFF_MAN_PAGES
# ${PROJECT_BINARY_DIR}/geotiff_version.h
-IF(WIN32)
- SET(DEFAULT_LIB_SUBDIR lib)
- SET(DEFAULT_DATA_SUBDIR .)
- SET(DEFAULT_INCLUDE_SUBDIR include)
-
- IF(MSVC)
- SET(DEFAULT_BIN_SUBDIR bin)
- ELSE()
- SET(DEFAULT_BIN_SUBDIR .)
- ENDIF()
-ELSE()
- # Common locatoins for Unix and Mac OS X
- SET(DEFAULT_BIN_SUBDIR bin)
- SET(DEFAULT_LIB_SUBDIR lib)
- SET(DEFAULT_DATA_SUBDIR share)
- SET(DEFAULT_INCLUDE_SUBDIR include)
-ENDIF()
+SET(DEFAULT_BIN_SUBDIR bin)
+SET(DEFAULT_LIB_SUBDIR lib)
+SET(DEFAULT_INCLUDE_SUBDIR include)
# Locations are changeable by user to customize layout of GeoTIFF installation
# (default values are platform-specIFic)
@@ -272,31 +249,26 @@ SET(GEOTIFF_LIB_SUBDIR ${DEFAULT_LIB_SUBDIR} CACHE STRING
"Subdirectory where libraries will be installed")
SET(GEOTIFF_INCLUDE_SUBDIR ${DEFAULT_INCLUDE_SUBDIR} CACHE STRING
"Subdirectory where header files will be installed")
-SET(GEOTIFF_DATA_SUBDIR ${DEFAULT_DATA_SUBDIR} CACHE STRING
- "Subdirectory where data will be installed")
# Mark *_SUBDIR variables as advanced and dedicated to use by power-users only.
-MARK_AS_ADVANCED(GEOTIFF_BIN_SUBDIR GEOTIFF_LIB_SUBDIR GEOTIFF_INCLUDE_SUBDIR GEOTIFF_DATA_SUBDIR)
+MARK_AS_ADVANCED(GEOTIFF_BIN_SUBDIR GEOTIFF_LIB_SUBDIR GEOTIFF_INCLUDE_SUBDIR)
# Full paths for the installation
SET(GEOTIFF_BIN_DIR ${GEOTIFF_BIN_SUBDIR})
SET(GEOTIFF_LIB_DIR ${GEOTIFF_LIB_SUBDIR})
SET(GEOTIFF_INCLUDE_DIR ${GEOTIFF_INCLUDE_SUBDIR})
-SET(GEOTIFF_DATA_DIR ${GEOTIFF_DATA_SUBDIR})
# Install doc files
INSTALL(FILES
AUTHORS ChangeLog COPYING INSTALL LICENSE README README_BIN README.WIN
DESTINATION doc)
-# DESTINATION ${GEOTIFF_DATA_DIR}/doc)
# Install man pages
INSTALL(FILES ${GEOTIFF_MAN_PAGES} DESTINATION share/man/man1)
# Install header files for development distribution
-# INSTALL(FILES ${GEOTIFF_LIB_HEADERS} DESTINATION ${GEOTIFF_INCLUDE_DIR})
-INSTALL(FILES ${GEOTIFF_LIB_HEADERS} DESTINATION include)
+INSTALL(FILES ${GEOTIFF_LIB_HEADERS} DESTINATION ${GEOTIFF_INCLUDE_DIR})
###############################################################################
# Build libxtiff library
@@ -338,11 +310,10 @@ IF(WIN32 AND MSVC)
ENDIF(WIN32 AND MSVC)
# Unix, linux:
-IF(UNIX)
+if(UNIX)
SET_TARGET_PROPERTIES(
${GEOTIFF_LIBRARY_TARGET}
PROPERTIES
- OUTPUT_NAME ${GEOTIFF_LIB_NAME}
VERSION ${LINK_VERSION}
SOVERSION ${LINK_SOVERSION}
CLEAN_DIRECT_OUTPUT 1 )
@@ -350,34 +321,38 @@ IF(UNIX)
set_target_properties(
${GEOTIFF_LIBRARY_TARGET}
PROPERTIES
- INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+ INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${GEOTIFF_LIB_DIR}")
endif()
-
-ELSE(UNIX)
-# Default:
- SET_TARGET_PROPERTIES(${GEOTIFF_LIBRARY_TARGET} PROPERTIES
- OUTPUT_NAME ${GEOTIFF_LIB_NAME})
-ENDIF(UNIX)
+endif()
SET_TARGET_PROPERTIES(${GEOTIFF_LIBRARY_TARGET} PROPERTIES
OUTPUT_NAME ${GEOTIFF_LIB_NAME})
-TARGET_LINK_LIBRARIES(${GEOTIFF_LIBRARY_TARGET}
- ${TIFF_LIBRARIES}
- ${PROJ_LIBRARIES}
- ${ZLIB_LIBRARIES}
- ${JPEG_LIBRARIES})
+if(TARGET TIFF::TIFF)
+target_link_libraries(${GEOTIFF_LIBRARY_TARGET} PUBLIC TIFF::TIFF)
+else()
+target_link_libraries(${GEOTIFF_LIBRARY_TARGET} PUBLIC
+ ${TIFF_LIBRARIES})
+endif()
+
+if(TARGET PROJ::proj)
+target_link_libraries(${GEOTIFF_LIBRARY_TARGET} PRIVATE PROJ::proj)
+else()
+target_link_libraries(${GEOTIFF_LIBRARY_TARGET} PRIVATE
+ ${PROJ_LIBRARIES})
+endif()
-# INSTALL(TARGETS ${GEOTIFF_ARCHIVE_TARGET} ${GEOTIFF_LIBRARY_TARGET}
-# RUNTIME DESTINATION ${GEOTIFF_BIN_DIR}
-# LIBRARY DESTINATION ${GEOTIFF_LIB_DIR}
-# ARCHIVE DESTINATION ${GEOTIFF_LIB_DIR})
+target_include_directories(
+ ${GEOTIFF_LIBRARY_TARGET}
+ PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
+ $<INSTALL_INTERFACE:${GEOTIFF_INCLUDE_DIR}>)
INSTALL( TARGETS ${GEOTIFF_LIBRARY_TARGET}
- EXPORT depends
- RUNTIME DESTINATION bin
- LIBRARY DESTINATION lib
- ARCHIVE DESTINATION lib )
+ EXPORT depends
+ RUNTIME DESTINATION ${GEOTIFF_BIN_DIR}
+ LIBRARY DESTINATION ${GEOTIFF_LIB_DIR}
+ PUBLIC_HEADER DESTINATION ${GEOTIFF_INCLUDE_DIR}
+ ARCHIVE DESTINATION ${GEOTIFF_LIB_DIR} )
# Define grouping of source files in PROJECT file (e.g. Visual Studio)
SOURCE_GROUP("CMake Files" FILES CMakeLists.txt)
=====================================
LICENSE
=====================================
@@ -3,7 +3,7 @@
====================
All the source code in this toolkit are either in the public domain, or under
-an X style license. In any event it is all considered to be free to use
+the MIT License. In any event it is all considered to be free to use
for any purpose (including commercial software). No credit is required
though some of the code requires that the specific source code modules
retain their existing copyright statements. In
=====================================
Makefile.am
=====================================
@@ -53,7 +53,7 @@ libgeotiff_la_SOURCES = cpl_serv.c \
geo_strtod.c \
geotiff_proj4.c
-libgeotiff_la_LDFLAGS = -version-info 7:0:2 ${NOUNDEFINED}
+libgeotiff_la_LDFLAGS = -version-info 7:1:2 ${NOUNDEFINED}
libgeotiff_la_LIBADD = libxtiff/libxtiff.la
=====================================
NEWS
=====================================
@@ -1,3 +1,17 @@
+libgeotiff 1.7.1
+----------------
+
+* geotiff.h: more precise signature for GTIFDirectoryInfo()
+* applygeo.c/geotifcp.c: use uint16/32_t instead of old libtiff non _t custom types
+* Bump CMake min to 3.0.0 and remove apparently unneeded cmake_policy() declarations
+* CMake: remove libjpeg and libz from linking of libgeotiff itself.
+* geo_config.h: prefix HAVE_xxx and restrict it to GEOTIFF_HAVE_STRINGS_H (fixes #61)
+* GTIFPrintDefn(): avoid potential nullptr deref. CID 1469240
+* CMake: use variable for installation subdirectories, and make sure INTERFACE_INCLUDE_DIRECTORIES is exported (fixes #67)
+* ReadKey(): only allow reading a key with TIFFTagLocation=0 that has a count of 1 to avoid reading an illegal address (and crashing) when using GTIFKeyGet() or PrintKey() (fixes #66)
+* ReadKey(): add extra warning messages
+* CMake: avoid INTERFACE_LINK_LIBRARIES vs LINK_INTERFACE_LIBRARIES_DEBUG warning about TIFF
+
libgeotiff 1.7.0
----------------
=====================================
bin/CMakeLists.txt
=====================================
@@ -22,11 +22,12 @@ MESSAGE(STATUS "Adding GeoTIFF utilities to build")
FOREACH(utility ${GEOTIFF_UTILITIES})
ADD_EXECUTABLE(${utility} ${utility}.c ${GETOPT_SOURCE})
- TARGET_LINK_LIBRARIES(${utility} xtiff ${GEOTIFF_LIBRARY_TARGET})
+ TARGET_LINK_LIBRARIES(${utility} PRIVATE xtiff ${GEOTIFF_LIBRARY_TARGET})
ENDFOREACH()
ADD_EXECUTABLE(geotifcp geotifcp.c ${GETOPT_SOURCE})
TARGET_LINK_LIBRARIES(geotifcp
+ PRIVATE
xtiff
${GEOTIFF_LIBRARY_TARGET}
${JPEG_LIBRARIES}
=====================================
bin/applygeo.c
=====================================
@@ -1,4 +1,5 @@
/* applygeo.c */
+#include <stdint.h>
#include <stdlib.h>
#include "geotiff.h"
#include "xtiffio.h"
@@ -10,8 +11,8 @@ InstallGeoTIFF(const char *geofile, const char *tiffile)
GTIF *gtif; /* GeoKey-level descriptor */
FILE *fp;
- uint16 *panVI = NULL;
- uint16 nKeyCount;
+ uint16_t *panVI = NULL;
+ uint16_t nKeyCount;
tif = XTIFFOpen(tiffile, "r+");
if (!tif)
@@ -28,7 +29,7 @@ InstallGeoTIFF(const char *geofile, const char *tiffile)
if( TIFFGetField( tif, TIFFTAG_GEOKEYDIRECTORY,
&nKeyCount, &panVI ) )
{
- uint16 anGKVersionInfo[4] = { 1, 1, 0, 0 };
+ uint16_t anGKVersionInfo[4] = { 1, 1, 0, 0 };
double adfDummyDoubleParams[1] = { 0.0 };
TIFFSetField( tif, TIFFTAG_GEOKEYDIRECTORY,
=====================================
bin/geotifcp.c
=====================================
@@ -9,6 +9,7 @@
* and a lot of legal stuff denying liability for anything.
*/
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -39,22 +40,22 @@
int getopt();
static int outtiled = -1;
-static uint32 tilewidth;
-static uint32 tilelength;
+static uint32_t tilewidth;
+static uint32_t tilelength;
static int convert_8_to_4 = 0;
-static uint16 config;
-static uint16 compression;
-static uint16 predictor;
-static uint16 fillorder;
-static uint32 rowsperstrip;
-static uint32 g3opts;
+static uint16_t config;
+static uint16_t compression;
+static uint16_t predictor;
+static uint16_t fillorder;
+static uint32_t rowsperstrip;
+static uint32_t g3opts;
static int ignore = FALSE; /* if true, ignore read errors */
-static uint32 defg3opts = (uint32) -1;
+static uint32_t defg3opts = (uint32_t) -1;
static int quality = 75; /* JPEG quality */
static int jpegcolormode = JPEGCOLORMODE_RGB;
-static uint16 defcompression = (uint16) -1;
-static uint16 defpredictor = (uint16) -1;
+static uint16_t defcompression = (uint16_t) -1;
+static uint16_t defpredictor = (uint16_t) -1;
static char *geofile=(char *)0;
static char *proj4_string = (char *) 0;
static char *worldfile=(char *)0;
@@ -97,12 +98,12 @@ static void SetVersionNumbers(GTIF* gtif)
int
main(int argc, char* argv[])
{
- uint16 defconfig = (uint16) -1;
- uint16 deffillorder = 0;
- uint32 deftilewidth = (uint32) -1;
- uint32 deftilelength = (uint32) -1;
- uint32 defrowsperstrip = (uint32) -1;
- uint32 diroff = 0;
+ uint16_t defconfig = (uint16_t) -1;
+ uint16_t deffillorder = 0;
+ uint32_t deftilewidth = (uint32_t) -1;
+ uint32_t deftilelength = (uint32_t) -1;
+ uint32_t defrowsperstrip = (uint32_t) -1;
+ uint32_t diroff = 0;
TIFF* in;
TIFF* out;
char mode[10];
@@ -345,7 +346,7 @@ static void CopyGeoTIFF(TIFF * in, TIFF *out)
{
GTIF *gtif; /* GeoKey-level descriptor */
double *d_list = NULL;
- int16 d_list_count;
+ int16_t d_list_count;
/* read definition from source file. */
gtif = GTIFNew(in);
@@ -376,7 +377,7 @@ static void
processG3Options(char* cp)
{
if( (cp = strchr(cp, ':')) != NULL ) {
- if (defg3opts == (uint32) -1)
+ if (defg3opts == (uint32_t) -1)
defg3opts = 0;
do {
cp++;
@@ -488,7 +489,7 @@ usage(void)
}
static void
-CheckAndCorrectColormap(TIFF* tif, int n, uint16* r, uint16* g, uint16* b)
+CheckAndCorrectColormap(TIFF* tif, int n, uint16_t* r, uint16_t* g, uint16_t* b)
{
int i;
@@ -515,8 +516,8 @@ CheckAndCorrectColormap(TIFF* tif, int n, uint16* r, uint16* g, uint16* b)
if (TIFFGetField(in, tag, &v1, &v2, &v3, &v4)) TIFFSetField(out, tag, v1, v2, v3, v4)
static struct cpTag {
- uint16 tag;
- uint16 count;
+ uint16_t tag;
+ uint16_t count;
TIFFDataType type;
} tags[] = {
{ TIFFTAG_SUBFILETYPE, 1, TIFF_LONG },
@@ -540,8 +541,8 @@ static struct cpTag {
{ TIFFTAG_DATETIME, 1, TIFF_ASCII },
{ TIFFTAG_ARTIST, 1, TIFF_ASCII },
{ TIFFTAG_HOSTCOMPUTER, 1, TIFF_ASCII },
- { TIFFTAG_WHITEPOINT, (uint16) -1,TIFF_RATIONAL },
- { TIFFTAG_PRIMARYCHROMATICITIES,(uint16) -1,TIFF_RATIONAL },
+ { TIFFTAG_WHITEPOINT, (uint16_t) -1,TIFF_RATIONAL },
+ { TIFFTAG_PRIMARYCHROMATICITIES,(uint16_t) -1,TIFF_RATIONAL },
{ TIFFTAG_HALFTONEHINTS, 2, TIFF_SHORT },
{ TIFFTAG_BADFAXLINES, 1, TIFF_LONG },
{ TIFFTAG_CLEANFAXDATA, 1, TIFF_SHORT },
@@ -551,11 +552,11 @@ static struct cpTag {
{ TIFFTAG_DOTRANGE, 2, TIFF_SHORT },
{ TIFFTAG_TARGETPRINTER, 1, TIFF_ASCII },
{ TIFFTAG_SAMPLEFORMAT, 1, TIFF_SHORT },
- { TIFFTAG_YCBCRCOEFFICIENTS, (uint16) -1,TIFF_RATIONAL },
+ { TIFFTAG_YCBCRCOEFFICIENTS, (uint16_t) -1,TIFF_RATIONAL },
{ TIFFTAG_YCBCRSUBSAMPLING, 2, TIFF_SHORT },
{ TIFFTAG_YCBCRPOSITIONING, 1, TIFF_SHORT },
- { TIFFTAG_REFERENCEBLACKWHITE, (uint16) -1,TIFF_RATIONAL },
- { TIFFTAG_EXTRASAMPLES, (uint16) -1, TIFF_SHORT },
+ { TIFFTAG_REFERENCEBLACKWHITE, (uint16_t) -1,TIFF_RATIONAL },
+ { TIFFTAG_EXTRASAMPLES, (uint16_t) -1, TIFF_SHORT },
{ TIFFTAG_SMINSAMPLEVALUE, 1, TIFF_DOUBLE },
{ TIFFTAG_SMAXSAMPLEVALUE, 1, TIFF_DOUBLE },
};
@@ -570,19 +571,19 @@ cpOtherTags(TIFF* in, TIFF* out)
switch (p->type) {
case TIFF_SHORT:
if (p->count == 1) {
- uint16 shortv;
+ uint16_t shortv;
CopyField(p->tag, shortv);
} else if (p->count == 2) {
- uint16 shortv1, shortv2;
+ uint16_t shortv1, shortv2;
CopyField2(p->tag, shortv1, shortv2);
- } else if (p->count == (uint16) -1) {
- uint16 shortv1;
- uint16* shortav;
+ } else if (p->count == (uint16_t) -1) {
+ uint16_t shortv1;
+ uint16_t* shortav;
CopyField2(p->tag, shortv1, shortav);
}
break;
case TIFF_LONG:
- { uint32 longv;
+ { uint32_t longv;
CopyField(p->tag, longv);
}
break;
@@ -590,7 +591,7 @@ cpOtherTags(TIFF* in, TIFF* out)
if (p->count == 1) {
float floatv;
CopyField(p->tag, floatv);
- } else if (p->count == (uint16) -1) {
+ } else if (p->count == (uint16_t) -1) {
float* floatav;
CopyField(p->tag, floatav);
}
@@ -604,7 +605,7 @@ cpOtherTags(TIFF* in, TIFF* out)
if (p->count == 1) {
double doublev;
CopyField(p->tag, doublev);
- } else if (p->count == (uint16) -1) {
+ } else if (p->count == (uint16_t) -1) {
double* doubleav;
CopyField(p->tag, doubleav);
}
@@ -615,15 +616,15 @@ cpOtherTags(TIFF* in, TIFF* out)
}
typedef int (*copyFunc)
- (TIFF* in, TIFF* out, uint32 l, uint32 w, uint16 samplesperpixel);
-static copyFunc pickCopyFunc(TIFF*, TIFF*, uint16, uint16);
+ (TIFF* in, TIFF* out, uint32_t l, uint32_t w, uint16_t samplesperpixel);
+static copyFunc pickCopyFunc(TIFF*, TIFF*, uint16_t, uint16_t);
static int
tiffcp(TIFF* in, TIFF* out)
{
- uint16 bitspersample = 0, samplesperpixel, shortv;
+ uint16_t bitspersample = 0, samplesperpixel, shortv;
copyFunc cf;
- uint32 w, l;
+ uint32_t w, l;
CopyField(TIFFTAG_IMAGEWIDTH, w);
CopyField(TIFFTAG_IMAGELENGTH, l);
@@ -635,7 +636,7 @@ tiffcp(TIFF* in, TIFF* out)
{
CopyField(TIFFTAG_BITSPERSAMPLE, bitspersample);
}
- if (compression != (uint16)-1)
+ if (compression != (uint16_t)-1)
TIFFSetField(out, TIFFTAG_COMPRESSION, compression);
else
CopyField(TIFFTAG_COMPRESSION, compression);
@@ -662,9 +663,9 @@ tiffcp(TIFF* in, TIFF* out)
* input image or, if nothing is defined, use the
* library default.
*/
- if (tilewidth == (uint32) -1)
+ if (tilewidth == (uint32_t) -1)
TIFFGetField(in, TIFFTAG_TILEWIDTH, &tilewidth);
- if (tilelength == (uint32) -1)
+ if (tilelength == (uint32_t) -1)
TIFFGetField(in, TIFFTAG_TILELENGTH, &tilelength);
TIFFDefaultTileSize(out, &tilewidth, &tilelength);
TIFFSetField(out, TIFFTAG_TILEWIDTH, tilewidth);
@@ -675,24 +676,24 @@ tiffcp(TIFF* in, TIFF* out)
* value from the input image or, if nothing is defined,
* use the library default.
*/
- if (rowsperstrip == (uint32) -1)
+ if (rowsperstrip == (uint32_t) -1)
TIFFGetField(in, TIFFTAG_ROWSPERSTRIP, &rowsperstrip);
rowsperstrip = TIFFDefaultStripSize(out, rowsperstrip);
TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
}
- if (config != (uint16) -1)
+ if (config != (uint16_t) -1)
TIFFSetField(out, TIFFTAG_PLANARCONFIG, config);
else
CopyField(TIFFTAG_PLANARCONFIG, config);
- if (g3opts != (uint32) -1)
+ if (g3opts != (uint32_t) -1)
TIFFSetField(out, TIFFTAG_GROUP3OPTIONS, g3opts);
else
CopyField(TIFFTAG_GROUP3OPTIONS, g3opts);
if (samplesperpixel <= 4) {
- uint16 *tr, *tg, *tb, *ta;
+ uint16_t *tr, *tg, *tb, *ta;
CopyField4(TIFFTAG_TRANSFERFUNCTION, tr, tg, tb, ta);
}
- { uint16 *red, *green, *blue;
+ { uint16_t *red, *green, *blue;
if (TIFFGetField(in, TIFFTAG_COLORMAP, &red, &green, &blue)) {
CheckAndCorrectColormap(in, 1<<bitspersample, red, green, blue);
TIFFSetField(out, TIFFTAG_COLORMAP, red, green, blue);
@@ -706,7 +707,7 @@ tiffcp(TIFF* in, TIFF* out)
break;
case COMPRESSION_LZW:
case COMPRESSION_DEFLATE:
- if (predictor != (uint16)-1)
+ if (predictor != (uint16_t)-1)
TIFFSetField(out, TIFFTAG_PREDICTOR, predictor);
else
CopyField(TIFFTAG_PREDICTOR, predictor);
@@ -731,17 +732,17 @@ tiffcp(TIFF* in, TIFF* out)
*/
#define DECLAREcpFunc(x) \
static int x(TIFF* in, TIFF* out, \
- uint32 imagelength, uint32 imagewidth, tsample_t spp)
+ uint32_t imagelength, uint32_t imagewidth, tsample_t spp)
#define DECLAREreadFunc(x) \
static void x(TIFF* in, \
- unsigned char* buf, uint32 imagelength, uint32 imagewidth, tsample_t spp)
-typedef void (*readFunc)(TIFF*, unsigned char*, uint32, uint32, tsample_t);
+ unsigned char* buf, uint32_t imagelength, uint32_t imagewidth, tsample_t spp)
+typedef void (*readFunc)(TIFF*, unsigned char*, uint32_t, uint32_t, tsample_t);
#define DECLAREwriteFunc(x) \
static int x(TIFF* out, \
- unsigned char* buf, uint32 imagelength, uint32 imagewidth, tsample_t spp)
-typedef int (*writeFunc)(TIFF*, unsigned char*, uint32, uint32, tsample_t);
+ unsigned char* buf, uint32_t imagelength, uint32_t imagewidth, tsample_t spp)
+typedef int (*writeFunc)(TIFF*, unsigned char*, uint32_t, uint32_t, tsample_t);
/*
* Contig -> contig by scanline for rows/strip change.
@@ -749,7 +750,7 @@ typedef int (*writeFunc)(TIFF*, unsigned char*, uint32, uint32, tsample_t);
DECLAREcpFunc(cpContig2ContigByRow)
{
unsigned char *buf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(in));
- uint32 row;
+ uint32_t row;
(void) imagewidth; (void) spp;
for (row = 0; row < imagelength; row++) {
@@ -773,7 +774,7 @@ DECLAREcpFunc(cpContig2ContigByRow_8_to_4)
{
unsigned char *buf_in = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(in));
unsigned char *buf_out = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out));
- uint32 row;
+ uint32_t row;
printf( "Downsample\n" );
@@ -816,7 +817,7 @@ DECLAREcpFunc(cpDecodedStrips)
(void) imagewidth; (void) spp;
if (buf) {
tstrip_t s, ns = TIFFNumberOfStrips(in);
- uint32 row = 0;
+ uint32_t row = 0;
for (s = 0; s < ns; s++) {
tsize_t cc = (row + rowsperstrip > imagelength) ?
TIFFVStripSize(in, imagelength - row) : stripsize;
@@ -840,7 +841,7 @@ DECLAREcpFunc(cpDecodedStrips)
DECLAREcpFunc(cpSeparate2SeparateByRow)
{
unsigned char *buf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(in));
- uint32 row;
+ uint32_t row;
tsample_t s;
(void) imagewidth;
@@ -868,8 +869,8 @@ DECLAREcpFunc(cpContig2SeparateByRow)
unsigned char *inbuf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(in));
unsigned char *outbuf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out));
register unsigned char *inp, *outp;
- register uint32 n;
- uint32 row;
+ register uint32_t n;
+ uint32_t row;
tsample_t s;
/* unpack channels */
@@ -905,8 +906,8 @@ DECLAREcpFunc(cpSeparate2ContigByRow)
unsigned char *inbuf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(in));
unsigned char *outbuf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out));
register unsigned char *inp, *outp;
- register uint32 n;
- uint32 row;
+ register uint32_t n;
+ uint32_t row;
tsample_t s;
for (row = 0; row < imagelength; row++) {
@@ -936,10 +937,10 @@ bad:
static void
cpStripToTile(unsigned char* out, unsigned char* in,
- uint32 rows, uint32 cols, int outskew, int inskew)
+ uint32_t rows, uint32_t cols, int outskew, int inskew)
{
while (rows-- > 0) {
- uint32 j = cols;
+ uint32_t j = cols;
while (j-- > 0)
*out++ = *in++;
out += outskew;
@@ -949,10 +950,10 @@ cpStripToTile(unsigned char* out, unsigned char* in,
static void
cpContigBufToSeparateBuf(unsigned char* out, unsigned char* in,
- uint32 rows, uint32 cols, int outskew, int inskew, tsample_t spp)
+ uint32_t rows, uint32_t cols, int outskew, int inskew, tsample_t spp)
{
while (rows-- > 0) {
- uint32 j = cols;
+ uint32_t j = cols;
while (j-- > 0)
*out++ = *in, in += spp;
out += outskew;
@@ -962,10 +963,10 @@ cpContigBufToSeparateBuf(unsigned char* out, unsigned char* in,
static void
cpSeparateBufToContigBuf(unsigned char* out, unsigned char* in,
- uint32 rows, uint32 cols, int outskew, int inskew, tsample_t spp)
+ uint32_t rows, uint32_t cols, int outskew, int inskew, tsample_t spp)
{
while (rows-- > 0) {
- uint32 j = cols;
+ uint32_t j = cols;
while (j-- > 0)
*out = *in++, out += spp;
out += outskew;
@@ -975,7 +976,7 @@ cpSeparateBufToContigBuf(unsigned char* out, unsigned char* in,
static int
cpImage(TIFF* in, TIFF* out, readFunc fin, writeFunc fout,
- uint32 imagelength, uint32 imagewidth, tsample_t spp)
+ uint32_t imagelength, uint32_t imagewidth, tsample_t spp)
{
int status = FALSE;
unsigned char* buf = (unsigned char *)
@@ -992,7 +993,7 @@ DECLAREreadFunc(readContigStripsIntoBuffer)
{
tsize_t scanlinesize = TIFFScanlineSize(in);
unsigned char *bufp = buf;
- uint32 row;
+ uint32_t row;
(void) imagewidth; (void) spp;
for (row = 0; row < imagelength; row++) {
@@ -1010,7 +1011,7 @@ DECLAREreadFunc(readSeparateStripsIntoBuffer)
(void) imagewidth;
if (scanline) {
unsigned char *bufp = buf;
- uint32 row;
+ uint32_t row;
tsample_t s;
for (row = 0; row < imagelength; row++) {
@@ -1035,12 +1036,12 @@ done:
DECLAREreadFunc(readContigTilesIntoBuffer)
{
unsigned char* tilebuf = (unsigned char *) _TIFFmalloc(TIFFTileSize(in));
- uint32 imagew = TIFFScanlineSize(in);
- uint32 tilew = TIFFTileRowSize(in);
+ uint32_t imagew = TIFFScanlineSize(in);
+ uint32_t tilew = TIFFTileRowSize(in);
int iskew = imagew - tilew;
unsigned char *bufp = buf;
- uint32 tw, tl;
- uint32 row;
+ uint32_t tw, tl;
+ uint32_t row;
(void) spp;
if (tilebuf == 0)
@@ -1048,17 +1049,17 @@ DECLAREreadFunc(readContigTilesIntoBuffer)
(void) TIFFGetField(in, TIFFTAG_TILEWIDTH, &tw);
(void) TIFFGetField(in, TIFFTAG_TILELENGTH, &tl);
for (row = 0; row < imagelength; row += tl) {
- uint32 nrow = (row+tl > imagelength) ? imagelength-row : tl;
- uint32 colb = 0;
- uint32 col;
+ uint32_t nrow = (row+tl > imagelength) ? imagelength-row : tl;
+ uint32_t colb = 0;
+ uint32_t col;
for (col = 0; col < imagewidth; col += tw) {
if (TIFFReadTile(in, tilebuf, col, row, 0, 0) < 0 &&
!ignore)
goto done;
if (colb + tilew > imagew) {
- uint32 width = imagew - colb;
- uint32 oskew = tilew - width;
+ uint32_t width = imagew - colb;
+ uint32_t oskew = tilew - width;
cpStripToTile(bufp + colb,
tilebuf, nrow, width,
oskew + iskew, oskew);
@@ -1076,22 +1077,22 @@ done:
DECLAREreadFunc(readSeparateTilesIntoBuffer)
{
- uint32 imagew = TIFFScanlineSize(in);
- uint32 tilew = TIFFTileRowSize(in);
+ uint32_t imagew = TIFFScanlineSize(in);
+ uint32_t tilew = TIFFTileRowSize(in);
int iskew = imagew - tilew;
unsigned char* tilebuf = (unsigned char *) _TIFFmalloc(TIFFTileSize(in));
unsigned char *bufp = buf;
- uint32 tw, tl;
- uint32 row;
+ uint32_t tw, tl;
+ uint32_t row;
if (tilebuf == 0)
return;
(void) TIFFGetField(in, TIFFTAG_TILEWIDTH, &tw);
(void) TIFFGetField(in, TIFFTAG_TILELENGTH, &tl);
for (row = 0; row < imagelength; row += tl) {
- uint32 nrow = (row+tl > imagelength) ? imagelength-row : tl;
- uint32 colb = 0;
- uint32 col;
+ uint32_t nrow = (row+tl > imagelength) ? imagelength-row : tl;
+ uint32_t colb = 0;
+ uint32_t col;
for (col = 0; col < imagewidth; col += tw) {
tsample_t s;
@@ -1104,7 +1105,7 @@ DECLAREreadFunc(readSeparateTilesIntoBuffer)
* visible portion and skewing factors.
*/
if (colb + tilew > imagew) {
- uint32 width = imagew - colb;
+ uint32_t width = imagew - colb;
int oskew = tilew - width;
cpSeparateBufToContigBuf(bufp+colb+s,
tilebuf, nrow, width,
@@ -1125,7 +1126,7 @@ done:
DECLAREwriteFunc(writeBufferToContigStrips)
{
tsize_t scanline = TIFFScanlineSize(out);
- uint32 row;
+ uint32_t row;
(void) imagewidth; (void) spp;
for (row = 0; row < imagelength; row++) {
@@ -1144,11 +1145,11 @@ DECLAREwriteFunc(writeBufferToSeparateStrips)
if (obuf == NULL)
return (0);
for (s = 0; s < spp; s++) {
- uint32 row;
+ uint32_t row;
for (row = 0; row < imagelength; row++) {
unsigned char* inp = buf + s;
unsigned char* outp = obuf;
- uint32 n = imagewidth;
+ uint32_t n = imagewidth;
while (n-- > 0)
*outp++ = *inp, inp += spp;
@@ -1165,13 +1166,13 @@ DECLAREwriteFunc(writeBufferToSeparateStrips)
DECLAREwriteFunc(writeBufferToContigTiles)
{
- uint32 imagew = TIFFScanlineSize(out);
- uint32 tilew = TIFFTileRowSize(out);
+ uint32_t imagew = TIFFScanlineSize(out);
+ uint32_t tilew = TIFFTileRowSize(out);
int iskew = imagew - tilew;
unsigned char* obuf = (unsigned char *) _TIFFmalloc(TIFFTileSize(out));
unsigned char* bufp = buf;
- uint32 tl, tw;
- uint32 row;
+ uint32_t tl, tw;
+ uint32_t row;
(void) spp;
if (obuf == NULL)
@@ -1179,9 +1180,9 @@ DECLAREwriteFunc(writeBufferToContigTiles)
(void) TIFFGetField(out, TIFFTAG_TILELENGTH, &tl);
(void) TIFFGetField(out, TIFFTAG_TILEWIDTH, &tw);
for (row = 0; row < imagelength; row += tilelength) {
- uint32 nrow = (row+tl > imagelength) ? imagelength-row : tl;
- uint32 colb = 0;
- uint32 col;
+ uint32_t nrow = (row+tl > imagelength) ? imagelength-row : tl;
+ uint32_t colb = 0;
+ uint32_t col;
for (col = 0; col < imagewidth; col += tw) {
/*
@@ -1189,7 +1190,7 @@ DECLAREwriteFunc(writeBufferToContigTiles)
* visible portion and skewing factors.
*/
if (colb + tilew > imagew) {
- uint32 width = imagew - colb;
+ uint32_t width = imagew - colb;
int oskew = tilew - width;
cpStripToTile(obuf, bufp + colb, nrow, width,
oskew, oskew + iskew);
@@ -1210,22 +1211,22 @@ DECLAREwriteFunc(writeBufferToContigTiles)
DECLAREwriteFunc(writeBufferToSeparateTiles)
{
- uint32 imagew = TIFFScanlineSize(out);
+ uint32_t imagew = TIFFScanlineSize(out);
tsize_t tilew = TIFFTileRowSize(out);
int iskew = imagew - tilew;
unsigned char *obuf = (unsigned char*) _TIFFmalloc(TIFFTileSize(out));
unsigned char *bufp = buf;
- uint32 tl, tw;
- uint32 row;
+ uint32_t tl, tw;
+ uint32_t row;
if (obuf == NULL)
return (FALSE);
(void) TIFFGetField(out, TIFFTAG_TILELENGTH, &tl);
(void) TIFFGetField(out, TIFFTAG_TILEWIDTH, &tw);
for (row = 0; row < imagelength; row += tl) {
- uint32 nrow = (row+tl > imagelength) ? imagelength-row : tl;
- uint32 colb = 0;
- uint32 col;
+ uint32_t nrow = (row+tl > imagelength) ? imagelength-row : tl;
+ uint32_t colb = 0;
+ uint32_t col;
for (col = 0; col < imagewidth; col += tw) {
tsample_t s;
@@ -1235,7 +1236,7 @@ DECLAREwriteFunc(writeBufferToSeparateTiles)
* visible portion and skewing factors.
*/
if (colb + tilew > imagew) {
- uint32 width = imagew - colb;
+ uint32_t width = imagew - colb;
int oskew = tilew - width;
cpContigBufToSeparateBuf(obuf,
@@ -1396,10 +1397,10 @@ DECLAREcpFunc(cpSeparateTiles2SeparateStrips)
* Select the appropriate copy function to use.
*/
static copyFunc
-pickCopyFunc(TIFF* in, TIFF* out, uint16 bitspersample, uint16 samplesperpixel)
+pickCopyFunc(TIFF* in, TIFF* out, uint16_t bitspersample, uint16_t samplesperpixel)
{
- uint16 shortv;
- uint32 w, l, tw, tl;
+ uint16_t shortv;
+ uint32_t w, l, tw, tl;
int bychunk;
(void) TIFFGetField(in, TIFFTAG_PLANARCONFIG, &shortv);
@@ -1422,7 +1423,7 @@ pickCopyFunc(TIFF* in, TIFF* out, uint16 bitspersample, uint16 samplesperpixel)
TIFFGetField(in, TIFFTAG_TILELENGTH, &tl);
bychunk = (tw == w && tl == rowsperstrip);
} else {
- uint32 irps = (uint32) -1L;
+ uint32_t irps = (uint32_t) -1L;
TIFFGetField(in, TIFFTAG_ROWSPERSTRIP, &irps);
bychunk = (rowsperstrip == irps);
}
=====================================
cmake/geo_config.h.in
=====================================
@@ -1,14 +1,8 @@
#ifndef GEO_CONFIG_H
#define GEO_CONFIG_H
-/* Define if you have the <stdlib.h> header file. */
-#cmakedefine HAVE_STDLIB_H
-
-/* Define if you have the <string.h> header file. */
-#cmakedefine HAVE_STRING_H
-
/* Define if you have the <strings.h> header file. */
-#cmakedefine HAVE_STRINGS_H
+#cmakedefine GEOTIFF_HAVE_STRINGS_H 1
#cmakedefine GEO_NORMALIZE_DISABLE_TOWGS84
=====================================
configure
=====================================
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libgeotiff 1.7.0.
+# Generated by GNU Autoconf 2.69 for libgeotiff 1.7.1.
#
# Report bugs to <warmerdam at pobox.com>.
#
@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libgeotiff'
PACKAGE_TARNAME='libgeotiff'
-PACKAGE_VERSION='1.7.0'
-PACKAGE_STRING='libgeotiff 1.7.0'
+PACKAGE_VERSION='1.7.1'
+PACKAGE_STRING='libgeotiff 1.7.1'
PACKAGE_BUGREPORT='warmerdam at pobox.com'
PACKAGE_URL=''
@@ -1422,7 +1422,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures libgeotiff 1.7.0 to adapt to many kinds of systems.
+\`configure' configures libgeotiff 1.7.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1493,7 +1493,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libgeotiff 1.7.0:";;
+ short | recursive ) echo "Configuration of libgeotiff 1.7.1:";;
esac
cat <<\_ACEOF
@@ -1639,7 +1639,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libgeotiff configure 1.7.0
+libgeotiff configure 1.7.1
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2008,7 +2008,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libgeotiff $as_me 1.7.0, which was
+It was created by libgeotiff $as_me 1.7.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2426,7 +2426,7 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-RELEASE_VERSION=1.7.0
+RELEASE_VERSION=1.7.1
ac_config_headers="$ac_config_headers geo_config.h"
@@ -2918,7 +2918,7 @@ fi
# Define the identity of the package.
PACKAGE='libgeotiff'
- VERSION='1.7.0'
+ VERSION='1.7.1'
cat >>confdefs.h <<_ACEOF
@@ -12164,20 +12164,24 @@ CFLAGS="$CFLAGS"
LIBS="$LDFLAGS $LIBS"
-for ac_header in string.h
+for ac_header in strings.h
do :
- ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default"
-if test "x$ac_cv_header_string_h" = xyes; then :
+ ac_fn_c_check_header_mongrel "$LINENO" "strings.h" "ac_cv_header_strings_h" "$ac_includes_default"
+if test "x$ac_cv_header_strings_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_STRING_H 1
+#define HAVE_STRINGS_H 1
_ACEOF
- HAVE_STRING_H=1
-else
- as_fn_error $? "cannot find string.h, bailing out" "$LINENO" 5
+ GEOTIFF_HAVE_STRINGS_H=1
fi
done
+
+cat >>confdefs.h <<_ACEOF
+#define GEOTIFF_HAVE_STRINGS_H 1
+_ACEOF
+
+
for ac_header in stdio.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default"
@@ -16180,7 +16184,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libgeotiff $as_me 1.7.0, which was
+This file was extended by libgeotiff $as_me 1.7.1, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -16246,7 +16250,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-libgeotiff config.status 1.7.0
+libgeotiff config.status 1.7.1
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
=====================================
configure.ac
=====================================
@@ -2,7 +2,7 @@
m4_define([VERSION_MAJOR], [1])
m4_define([VERSION_MINOR], [7])
-m4_define([VERSION_POINT], [0])
+m4_define([VERSION_POINT], [1])
m4_define([GEOTIFF_VERSION],
[VERSION_MAJOR.VERSION_MINOR.VERSION_POINT])
@@ -45,7 +45,11 @@ dnl #########################################################################
dnl Checks for header files.
dnl #########################################################################
-AC_CHECK_HEADERS([string.h],[HAVE_STRING_H=1], [AC_MSG_ERROR([cannot find string.h, bailing out])])
+dnl AC_CHECK_HEADERS([string.h],[HAVE_STRING_H=1], [AC_MSG_ERROR([cannot find string.h, bailing out])])
+AC_CHECK_HEADERS([strings.h],[GEOTIFF_HAVE_STRINGS_H=1])
+AC_DEFINE_UNQUOTED(GEOTIFF_HAVE_STRINGS_H, 1,
+ [Define if you have the <strings.h> header file.])
+
AC_CHECK_HEADERS([stdio.h],, [AC_MSG_ERROR([cannot find stdio.h, bailing out])])
AC_CHECK_HEADERS([stdlib.h],, [AC_MSG_ERROR([cannot find stdlib.h, bailing out])])
=====================================
cpl_serv.h
=====================================
@@ -38,15 +38,11 @@
#include <math.h>
-#ifdef HAVE_STRING_H
-# include <string.h>
-#endif
-#if defined(HAVE_STRINGS_H) && !defined(_WIN32)
+#include <string.h>
+#if defined(GEOTIFF_HAVE_STRINGS_H) && !defined(_WIN32)
# include <strings.h>
#endif
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
+#include <stdlib.h>
/**********************************************************************
* Do we want to build as a DLL on windows?
=====================================
debian/changelog
=====================================
@@ -1,3 +1,18 @@
+libgeotiff (1.7.1~rc1-1~exp1) experimental; urgency=medium
+
+ * New upstream release candidate.
+ * Bump Standards-Version to 4.6.0, no changes.
+ * Bump debhelper compat to 12, changes:
+ - Drop --list-missing from dh_install
+
+ -- Bas Couwenberg <sebastic at debian.org> Tue, 08 Mar 2022 17:30:10 +0100
+
+libgeotiff (1.7.0-2) unstable; urgency=medium
+
+ * Move from experimental to unstable.
+
+ -- Bas Couwenberg <sebastic at debian.org> Sun, 15 Aug 2021 10:39:14 +0200
+
libgeotiff (1.7.0-1) experimental; urgency=medium
* New upstream release.
=====================================
debian/compat deleted
=====================================
@@ -1 +0,0 @@
-10
=====================================
debian/control
=====================================
@@ -5,13 +5,13 @@ Uploaders: Francesco Paolo Lovergine <frankie at debian.org>,
Bas Couwenberg <sebastic at debian.org>
Section: science
Priority: optional
-Build-Depends: debhelper (>= 10~),
+Build-Depends: debhelper-compat (= 12),
libjpeg-dev,
libproj-dev (>= 6.0.0),
libtiff-dev,
pkg-config,
zlib1g-dev
-Standards-Version: 4.5.1
+Standards-Version: 4.6.0
Vcs-Browser: https://salsa.debian.org/debian-gis-team/libgeotiff
Vcs-Git: https://salsa.debian.org/debian-gis-team/libgeotiff.git -b experimental
Homepage: https://geotiff.osgeo.org/
=====================================
debian/rules
=====================================
@@ -25,7 +25,7 @@ override_dh_clean:
override_dh_install:
$(RM) debian/*/usr/lib/*/libgeotiff.la
- dh_install --list-missing
+ dh_install
override_dh_installchangelogs:
dh_installchangelogs ChangeLog
=====================================
geo_config.h.in
=====================================
@@ -1,20 +1,8 @@
#ifndef GEO_CONFIG_H
#define GEO_CONFIG_H
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
/* Define if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-#undef HAVE_LIBPROJ
-#undef HAVE_PROJECTS_H
+#undef GEOTIFF_HAVE_STRINGS_H
#undef GEO_NORMALIZE_DISABLE_TOWGS84
=====================================
geo_new.c
=====================================
@@ -33,9 +33,9 @@ static void GTIFErrorFunction(GTIF* gt, int level, const char* msg, ...)
va_start(list, msg);
if( level == LIBGEOTIFF_WARNING )
- fprintf(stderr, "Warning :");
+ fprintf(stderr, "Warning: ");
else if( level == LIBGEOTIFF_ERROR )
- fprintf(stderr, "Error :");
+ fprintf(stderr, "Error: ");
vfprintf(stderr, msg, list);
fprintf(stderr, "\n");
va_end(list);
@@ -267,21 +267,69 @@ static int ReadKey(GTIF* gt, TempKeyData* tempData,
{
case GTIFF_LOCAL:
/* store value into data value */
+ if (count != 1 )
+ {
+ if( gt->gt_error_callback )
+ {
+ gt->gt_error_callback(
+ gt,
+ LIBGEOTIFF_ERROR,
+ "Key %s of TIFFTagLocation=0 has count=%d, "
+ "whereas only 1 is legal.",
+ GTIFKeyName(keyptr->gk_key), count);
+ }
+ return 0;
+ }
memcpy(&keyptr->gk_data, &(entptr->ent_val_offset), sizeof(pinfo_t));
break;
case GTIFF_GEOKEYDIRECTORY:
keyptr->gk_data = (char *)(gt->gt_short+offset);
if (gt->gt_nshorts < offset+count)
+ {
+ if( gt->gt_error_callback )
+ {
+ gt->gt_error_callback(
+ gt,
+ LIBGEOTIFF_ERROR,
+ "Key %s of type SHORT has offset=%d and count=%d, "
+ "but the GeoKeyDirectory tag has only %d values.",
+ GTIFKeyName(keyptr->gk_key),
+ offset, count, gt->gt_nshorts);
+ }
return 0;
+ }
break;
case GTIFF_DOUBLEPARAMS:
keyptr->gk_data = (char *)(gt->gt_double+offset);
if (gt->gt_ndoubles < offset+count)
+ {
+ if( gt->gt_error_callback )
+ {
+ gt->gt_error_callback(
+ gt,
+ LIBGEOTIFF_ERROR,
+ "Key %s of type SHORT has offset=%d and count=%d, "
+ "but the GeoDoubleParams tag has only %d values.",
+ GTIFKeyName(keyptr->gk_key),
+ offset, count, gt->gt_ndoubles);
+ }
return 0;
+ }
break;
case GTIFF_ASCIIPARAMS:
if( tempData->tk_asciiParams == NULL )
+ {
+ if( gt->gt_error_callback )
+ {
+ gt->gt_error_callback(
+ gt,
+ LIBGEOTIFF_ERROR,
+ "Key %s is of type ASCII but GeoAsciiParams is "
+ "missing or corrupted.",
+ GTIFKeyName(keyptr->gk_key));
+ }
return 0;
+ }
if( offset + count == tempData->tk_asciiParamsLength + 1
&& count > 0 )
{
@@ -294,11 +342,33 @@ static int ReadKey(GTIF* gt, TempKeyData* tempData,
else if (offset < tempData->tk_asciiParamsLength
&& offset + count > tempData->tk_asciiParamsLength )
{
+ if( gt->gt_error_callback )
+ {
+ gt->gt_error_callback(
+ gt,
+ LIBGEOTIFF_WARNING,
+ "Key %s of type ASCII has offset=%d and count=%d, but "
+ "the GeoAsciiParams tag has only %d bytes. "
+ "Truncating the value of the key.",
+ GTIFKeyName(keyptr->gk_key), offset, count,
+ tempData->tk_asciiParamsLength);
+ }
count = tempData->tk_asciiParamsLength - offset;
- /* issue warning... if we could */
}
else if (offset + count > tempData->tk_asciiParamsLength)
+ {
+ if( gt->gt_error_callback )
+ {
+ gt->gt_error_callback(
+ gt,
+ LIBGEOTIFF_ERROR,
+ "Key %s of type ASCII has offset=%d and count=%d, "
+ "but the GeoAsciiParams tag has only %d values.",
+ GTIFKeyName(keyptr->gk_key), offset, count,
+ tempData->tk_asciiParamsLength);
+ }
return 0;
+ }
keyptr->gk_count = MAX(1,count+1);
keyptr->gk_data = (char *) _GTIFcalloc (keyptr->gk_count);
@@ -314,6 +384,14 @@ static int ReadKey(GTIF* gt, TempKeyData* tempData,
keyptr->gk_data[MAX(0,count)] = '\0';
break;
default:
+ if( gt->gt_error_callback )
+ {
+ gt->gt_error_callback(
+ gt,
+ LIBGEOTIFF_ERROR,
+ "Key %d of unknown type.",
+ keyptr->gk_key);
+ }
return 0; /* failure */
}
keyptr->gk_size = _gtiff_size[keyptr->gk_type];
=====================================
geo_normalize.c
=====================================
@@ -2990,8 +2990,11 @@ void GTIFPrintDefnEx( GTIF *psGTIF, GTIFDefn * psDefn, FILE * fp )
void GTIFPrintDefn( GTIFDefn * psDefn, FILE * fp )
{
GTIF *psGTIF = GTIFNew(NULL);
- GTIFPrintDefnEx(psGTIF, psDefn, fp);
- GTIFFree(psGTIF);
+ if( psGTIF )
+ {
+ GTIFPrintDefnEx(psGTIF, psDefn, fp);
+ GTIFFree(psGTIF);
+ }
}
/************************************************************************/
=====================================
geotiff.h
=====================================
@@ -47,7 +47,7 @@
#define GEOTIFF_SPEC_1_1_MINOR_REVISION 1
/* Library version */
-#define LIBGEOTIFF_VERSION 1700
+#define LIBGEOTIFF_VERSION 1710
#include "geo_config.h"
#include "geokeys.h"
@@ -131,7 +131,7 @@ GTIF GTIF_DLL *GTIFNewWithMethodsEx(void *tif, TIFFMethod* methods,
void GTIF_DLL GTIFFree(GTIF *gtif);
int GTIF_DLL GTIFWriteKeys(GTIF *gtif);
/* versions must be an array of 3 int */
-void GTIF_DLL GTIFDirectoryInfo(GTIF *gtif, int *versions, int *keycount);
+void GTIF_DLL GTIFDirectoryInfo(GTIF *gtif, int versions[3], int *keycount);
void GTIF_DLL *GTIFGetUserData(GTIF *gtif);
int GTIF_DLL GTIFSetVersionNumbers(GTIF* gtif,
unsigned short version,
View it on GitLab: https://salsa.debian.org/debian-gis-team/libgeotiff/-/compare/edd8836de07af2e7be08469c96118a56e728c3bc...6e0e6c39803681a1789d0f4099290e831a76a440
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/libgeotiff/-/compare/edd8836de07af2e7be08469c96118a56e728c3bc...6e0e6c39803681a1789d0f4099290e831a76a440
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20220308/74f60850/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list