2013.10.28 07:43 "[Tiff] Does TIFF support 15-bit (RGB555 or 5551) images?", by Nikos Chantziaras

2013.12.02 20:17 "Re: [Tiff] Compile problem in tif_jpeg.c", by Nacho Man

I got it to compile by adding some lines to tiffiop.h in the tiff-4.0.3/libtiff directory.  It seems to do the job.  I haven't programmed in years and I'm not 100% sure this is the right way to go about it.  Can anyone confirm if this could have any negative effects?  Here's what it was before:

#define    streq(a,b)      (strcmp(a,b) == 0)

#ifndef TRUE
#define TRUE    1
#define FALSE   0
#endif

Here's what it is after my changes:

#define    streq(a,b)      (strcmp(a,b) == 0)

#ifndef HAVE_BOOLEAN
# ifndef TRUE
#  define TRUE    1
#  define FALSE   0               /* values of boolean */
# endif
typedef unsigned char boolean;
#define HAVE_BOOLEAN
#endif

I do get some warnings when I compile now.   Like in tiff-4.0.3/contrib/iptcutil/iptcutil.c:241:4:
warning: comparison is always false due to limited range of data type [-Wtype-limits]
And some warnings about variables being set but never used.  I created a simple C program to try and figure out why I'm getting the comparison is always true or false.  Below is the code for that.

#include <stdio.h>
#include <stdlib.h>

int main() {
    char c;

    FILE *ifile=fopen("mytestfile","r");

    while ((c = getc(ifile)) != EOF) {
        printf("%c",c);
    }

}

When I compile it using my native GNU C compiler on my Linux system with the -Wtype-limits flag, I get no errors.   If I use the PS3's Toolchain GCC to compile it, I get the warning: comparison is always true due to limited range of data type [-Wtype-limits] warning.   If I change the char c; to  a signed char c; and try to compile, no error.  I thought that was weird though.   I though the value range for a signed char was -127 to 127 and for unsigned 0 - 255.   Seeing how the ASCII character chart goes from 0-255, wouldn't I need to use unsigned and not signed?  Any character read from the file would be between 0-255, right?   There shouldn't be any negative values.  Could someone explain if those warnings are correct and should I change the codes in the tiff library so it uses signed char's instead of just char's for the various warning messages?  Thanks.

On Monday, December 2, 2013 10:02 AM, Bob Friesenhahn <bfriesen@simple.dallas.tx.us> wrote:

On Sun, 1 Dec 2013, Nacho Man wrote:

> Hello,

> I am working on updating the PS3Libraries to the latest versions.  It was using an older version of the tiff library (3.9.4) and an older library of libzip (0.9.3).  I have successfully compiled libzip (0.11.1) but now I have trouble compiling the tiff library (4.0.3).   The error message I receive is as follows:

>
> In file included from ../../libtiff/tif_jpeg.c:30:0:
> ../../libtiff/tiffiop.h:72:16: error: expected identifier before numeric constant
>  # define FALSE 0
>                 ^
> /usr/local/ps3dev/portlibs/ppu/include/jmorecfg.h:263:16: note: in expansion of macro 'FALSE'
>  typedef enum { FALSE = 0, TRUE = 1 } boolean;
>                 ^
> make[2]: *** [tif_jpeg.lo] Error 1

This is a problem with libjpeg 9.  I argued with Guido that he should

not rely on this syntax but he did anyway.  If you can not figure out

a work-around, you could try an earlier release.

There is a development version of libjpeg 9's successor available from

"http://www.infai.org/jpeg/".  It claims to have solved this problem.

I have not tested this development version and it is possible that the

new features might cause some issue with libtiff.

Tiff mailing list: Tiff@lists.ma