jpg: ignore sampling factors for grayscale as colormap1() doesnt handle it

This commit is contained in:
cinap_lenrek 2012-08-14 05:36:05 +02:00
parent a8d7bbeeb3
commit 21b5efe962

View file

@ -328,6 +328,9 @@ readslave(Header *header, int colorspace)
nibbles(b[6+3*i+1], &H, &V);
if(H<=0 || V<=0)
jpgerror(header, "non-positive sampling factor (Hsamp or Vsamp)");
/* hack: colormap1() doesnt handle resampling */
if(header->Nf == 1)
H = V = 1;
header->comp[i].H = H;
header->comp[i].V = V;
header->comp[i].Tq = b[6+3*i+2];