From: pcnot4me@cs.montana.edu (Craig Pratt)
Subject: Bug in JPEG routine ?
Reply-To: pcnot4me@cs.montana.edu (Craig Pratt)
Organization: Dept. of Computer Science, MSU, Bozeman Mt 59717
Date: Tue, 17 Nov 1992 04:51:03 GMT

Howdy all!

A 24-bit TIFF image I've been messing with seems to have uncovered a
bug in Next's JPEG compression routine.  The image was created with a
ray tracer and contains a large number of red shades.  When I save it
as a JPEG TIFF out of GraphicsWorkshop (thanks to Alex Raftis) or run
it through tiffutil, the resulting image has a major problem.  The
brightest shade of red is transformed into a nasty green color.  This
happens in whatever program I bring it into, leading me to believe
that it's a problem with the underlying routine not the application
programs.

Has anyone else run into this?

Here's a miniature of the uuencoded LZW-compressed TIFF that illustrates 
the problem: (sorry about the BW, but I think this is important)  (sorry
again that this isn't in NewsGrazer, but I'm not directly on the net, 
unfortunately)

begin 644 Drums.tiff
M34T *@  & 2 .E6,MGJI#%HRF8\I4JF<RG@\GE$IM4LUOO]^O^-/]VLY5JE,
MGDTG8T%4K'=-$4RF]-*Q=KI5)A,KI>,]](<ZJ4J%9+&8S(8TG=,.E=-QWQND
M/]^-M<JA+G\[*:$K4J$0K(I6LQF,M=+U5+Q^MUE*@[54BGE#&9;&=,*E-JQ?
MMY_T>D/Y_+U6)I,-@SI8K'\RD0B$94+]ONVMLE5KR+NQ4V4B$4N/8S&H[JA-
M*IEMZZ4F..MM*Q,)='G8TM8JU4[(EFQIVLI5*O6QIE*9:$0JE4]G8SK@]HEM
M8;.TE_,Y=NI-(A;F8WF8JD4BFQ-1M_,M,J]G1M^H5#D7<E9#G=5(AE*]F.[/
M=1^05\HSPL8RE4KHI[IND/M4N_LQM+/>2I,90[D<3)-E6HSTHV;IEE83),CN
M1([-R-Y:DL;;J'63)5KDC1^DN^13C**PTD01!5%4;AGG]!"-F:?16E01!KCL
M,P\$L*@TGXZBF$V_:-&.R(SE4,PSCZ1!%1<;R+Q6=Y^%X=1$E8.XS#0YRK$8
MI!>$T=4>GZ4Y".\/)[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"(EU!<3(EQ 32((LI. "W22?F+
M"4532""@.F7,P30F X2^70J "(")JRT%6*H59"E^RYA^S^;RREP1S64 "<S^
M6LM9ELZB=KE \&PB\MHV$C(>3X=X0D 4_H*OH+4M$"("H\SHH2YL@P#0<T-9
M^'!<B;UE3DGP^.A(X"%EHFU-J'XEU 4%(1,&8M":$T7(7.V%4\97$*E\ NE]
M"2'49IM#^G)# 0+*I%3ZDCD9VH1:H08 2 )]4^J!4NFHF%Z$0JY2,C*CR%5H
M(R[0C0,E\D1 &[4$:I5%5U4/75   UU5[(>MMY3M$K$2 %6ZP@,D]EC>]8FQ
M((%.$'K17JO=D9U$(:57\$0,J!KI7Q9NPI!B @ - 0   P    $ 9    0$ 
M P    $ 2@   0(  P    ,  !BF 0,  P    $ !0   08  P    $  @  
M 1$ !     ,  !BL 14  P    $  P   18 !     $   */ 1< !     , 
M !BX 1H !0    $  !C$ 1L !0    $  !C, 1P  P    $  @   2@  P  
M  $  @         $  0 !     @   R5   2*0  #(T   64   %VP *_(  
+ "<0  K\@   )Q $
 
end

-- 
  Craig Pratt                                          pcnot4me@cs.montana.edu
  Montana State University, Bozeman MT            gcp1070@msu.oscs.montana.edu
   What's the difference between a used-car salesman and a computer salesman?
       A used-car salesman knows when he is lying. - Andrew Loewenstern
Newsgroups: comp.sys.next.software