From 29a8e72dcbd595ccc9c8778789ac8a0bcf36e02b Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 22 Sep 2011 21:34:40 +0000 Subject: Minor TIFF updates git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3971 42af7a65-404d-4744-a932-0658087f49c3 --- apps/graphics/tiff/tiff_initialize.c | 16 ++++++++++------ apps/graphics/tiff/tiff_utils.c | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/apps/graphics/tiff/tiff_initialize.c b/apps/graphics/tiff/tiff_initialize.c index a7194d552..b7eb3bd41 100644 --- a/apps/graphics/tiff/tiff_initialize.c +++ b/apps/graphics/tiff/tiff_initialize.c @@ -203,14 +203,18 @@ #define TIFF_RGB_STRIPBCOFFSET 248 /* Debug *******************************************************************/ +/* CONFIG_DEBUG_TIFFOFFSETS may be defined (along with CONFIG_DEBUG and + * CONFIG_DEBUG_GRAPHICS) in order to verify the pre-determined TIFF file + * offsets. + */ -#ifndef CONFIG_DEBUG -# undef CONFIG_DEBUG_GRAPHICS +#if !defined(CONFIG_DEBUG) || !defined(CONFIG_DEBUG_GRAPHICS) +# undef CONFIG_DEBUG_TIFFOFFSETS #endif -#ifdef CONFIG_DEBUG_GRAPHICS +#ifdef CONFIG_DEBUG_TIFFOFFSETS # define tiff_offset(o,l) (o) += (l) -# define tiff_checkoffs(o,x) ASSERT((o) == (x)); +# define tiff_checkoffs(o,x) ASSERT((o) == (x)) #else # define tiff_offset(o,l) # define tiff_checkoffs(o,x) @@ -307,7 +311,7 @@ static inline int tiff_putheader(FAR struct tiff_info_s *info) /* 4-7: Offset to the first IFD */ - tiff_put16(hdr.offset, TIFF_IFD_OFFSET); + tiff_put32(hdr.offset, TIFF_IFD_OFFSET); /* Write the header to the output file */ @@ -446,7 +450,7 @@ static int tiff_datetime(FAR char *timbuf, unsigned int buflen) int tiff_initialize(FAR struct tiff_info_s *info) { uint16_t val16; -#if CONFIG_DEBUG_GRAPHICS +#if CONFIG_DEBUG_TIFFOFFSETS off_t offset = 0; #endif char timbuf[TIFF_DATETIME_STRLEN + 8]; diff --git a/apps/graphics/tiff/tiff_utils.c b/apps/graphics/tiff/tiff_utils.c index 66599db8b..c326d0274 100644 --- a/apps/graphics/tiff/tiff_utils.c +++ b/apps/graphics/tiff/tiff_utils.c @@ -378,4 +378,4 @@ ssize_t tiff_wordalign(int fd, size_t size) size += nbytes; } return size; -} \ No newline at end of file +} -- cgit v1.2.3