AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
June 2012

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2012.06.28 09:23 "tiff 4.0.2 raw_decode test failing on ppc64", by Dinar Valeev
2012.07.03 17:53 "Re: tiff 4.0.2 raw_decode test failing on ppc64", by Tom Lane
2012.07.03 18:08 "Re: tiff 4.0.2 raw_decode test failing on ppc64", by Frank Warmerdam
2012.07.03 18:29 "Re: tiff 4.0.2 raw_decode test failing on ppc64", by Tom Lane
2012.07.04 16:26 "Re: tiff 4.0.2 raw_decode test failing on ppc64", by Bob Friesenhahn
2012.07.04 17:27 "Re: tiff 4.0.2 raw_decode test failing on ppc64", by Tom Lane
2012.07.04 19:49 "Re: tiff 4.0.2 raw_decode test failing on ppc64", by Bob Friesenhahn
2012.07.05 18:56 "Re: tiff 4.0.2 raw_decode test failing on ppc64", by Bob Friesenhahn
2012.07.05 21:54 "Crash in raw_decode with libjpeg 8d (was Re: tiff 4.0.2 raw_decode test failing on ppc64)", by Even Rouault
2012.07.06 16:17 "Re: Crash in raw_decode with libjpeg 8d (was Re: tiff 4.0.2 raw_decode test failing on ppc64)", by Bob Friesenhahn
2012.07.06 17:08 "Re: Crash in raw_decode with libjpeg 8d (was Re: tiff 4.0.2 raw_decode test failing on ppc64)", by Bob Friesenhahn
2012.07.03 18:09 "Re: tiff 4.0.2 raw_decode test failing on ppc64", by Dinar Valeev
2012.07.03 19:05 "Re: tiff 4.0.2 raw_decode test failing on ppc64", by Tom Lane
2012.07.03 19:25 "Re: tiff 4.0.2 raw_decode test failing on ppc64", by Dinar Valeev

2012.07.03 18:08 "Re: tiff 4.0.2 raw_decode test failing on ppc64", by Frank Warmerdam

Tom,

The approach looks good to me.  I'm a bit embarassed at having written
the test without realizing the endian dependent nature of
TIFFReadRGBATile's output.  If you are ok to fix this that is great
otherwise I could do so.

Best regards,


On Tue, Jul 3, 2012 at 10:53 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Dinar Valeev <dinarv@gmail.com> writes:
>> rgba part of the raw_decode test fails on ppc64 machine:
>
> I received a patch for this, uncredited but apparently originating
> somewhere in opensuse:
>
> diff -up tiff-4.0.2/test/raw_decode.c.bigendian
> tiff-4.0.2/test/raw_decode.c
> --- tiff-4.0.2/test/raw_decode.c.bigendian      2012-07-03
> 15:27:37.168543695 +0200
> +++ tiff-4.0.2/test/raw_decode.c        2012-07-03 15:28:47.795051599
> +0200
> @@ -85,9 +85,9 @@ static int check_rgb_pixel( int pixel, i
>  static int check_rgba_pixel( int pixel, int red, int green, int blue, int
>  alpha, unsigned char *buffer ) {
>         /* RGBA images are upside down - adjust for normal ordering */
>         int adjusted_pixel = pixel % 128 + (127 - (pixel/128)) * 128;
> -       unsigned char *rgba = buffer + 4 * adjusted_pixel;
> +       unsigned int *rgba = (unsigned int*)(buffer + 4 * adjusted_pixel);
>
> -       if( rgba[0] == red && rgba[1] == green && rgba[2] == blue &&
> rgba[3] == alpha ) {
> +       if( TIFFGetR(*rgba) == red && TIFFGetG(*rgba) == green &&
> TIFFGetB(*rgba) == blue && TIFFGetA(*rgba) == alpha ) {
>                 return 0;
>         }
>
>
> Now, this patch is crummy --- for one thing it ought to correct the
> fprintf call just below here.  But I think it's on the right track: the
> result of TIFFReadRGBAImage is documented to be accessed via these
> macros not directly.  Does anyone think this is not an appropriate fix
> approach?
>
>                         regards, tom lane
> _______________________________________________
> Tiff mailing list: Tiff@lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/tiff
> http://www.remotesensing.org/libtiff/



-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Software Developer