}
case 16:
{
- bytes_per_row=2*(((size_t) samples_per_pixel*columns*bits_per_pixel+8)/
- 16);
+ if (pad == MagickFalse)
+ {
+ bytes_per_row=2*(((size_t) samples_per_pixel*columns*bits_per_pixel+
+ 15)/16);
+ break;
+ }
+ bytes_per_row=4*(((size_t) samples_per_pixel*columns*bits_per_pixel+31)/
+ 32);
break;
}
case 32:
if ((horizontal_factor == 2) || (vertical_factor == 2))
quantum_type=CbYCrYQuantum;
}
- extent=GetBytesPerRow(image->columns,image->alpha_trait != UndefinedPixelTrait ?
- 4UL : 3UL,image->depth,MagickTrue);
+ extent=GetBytesPerRow(image->columns,
+ image->alpha_trait != UndefinedPixelTrait ? 4UL : 3UL,image->depth,
+ dpx.image.image_element[0].packing == 0 ? MagickFalse : MagickTrue);
if ((image_info->type != TrueColorType) &&
(image->alpha_trait == UndefinedPixelTrait) &&
(IsImageGray(image,exception) != MagickFalse))
{
quantum_type=GrayQuantum;
- extent=GetBytesPerRow(image->columns,1UL,image->depth,MagickTrue);
+ extent=GetBytesPerRow(image->columns,1UL,image->depth,
+ dpx.image.image_element[0].packing == 0 ? MagickFalse : MagickTrue);
}
pixels=GetQuantumPixels(quantum_info);
for (y=0; y < (ssize_t) image->rows; y++)