Picture flipped(mirror image) after conversion to Color TIFF - 25035150

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
Ganesh_B
Posts: 13
Joined: 2018-03-06T05:29:40-07:00
Authentication code: 1152

Picture flipped(mirror image) after conversion to Color TIFF - 25035150

Post by Ganesh_B »

  • Hi,
    Please check below columns to understand Image flip issue with attached specific file ‘IMG_0233.jpg’ after conversion to Color TIFF.
  • Subject ==> Picture flipped(mirror image) after conversion to Color TIFF - 25035150
  • Problem description ==> We have a Customer issue for a specific image ‘IMG_0233.jpg’ file where image is flipped after conversion to Color/Grayscale, 300 or 200 resolution TIFF file using class ‘class MagickPPExport Image’. TIFF file viewed in IrfanView viewer.
  • Replicate ==> We can see issue every time when we write code similar as in Code Snippet section below.
  • Code Snippets ==>
    Image img;
    img.read(“IMG_0233.jpg”);
    img->density(300x300);//illustrative
    img->quality(50);
    img->resolutionUnits(PixelsPerInchResolution);
    img.compressType(JPEG); //illustrative
    img.type(TrueColour); //illustrative
    img.depth(8);
    img.write(“Converted - 2019-06-21T115901.857.tiff”);
  • Component(s) ==> Image Magick Source build
  • Support request ==> Please find the root-cause for Image getting flipped or mirror image of original after conversion to Color TIFF file.
Regards
Ganesh.
Last edited by Ganesh_B on 2019-06-21T02:15:18-07:00, edited 2 times in total.
Ganesh_B
Posts: 13
Joined: 2018-03-06T05:29:40-07:00
Authentication code: 1152

Re: Picture flipped(mirror image) after conversion to Color TIFF - 25035150

Post by Ganesh_B »

  • Version ==> ImageMagick 7.0.8-12
  • Support request ==> Please find the root-cause for Image getting flipped or mirror image of original after conversion to Color TIFF file.
246246
Posts: 190
Joined: 2015-07-06T07:38:22-07:00
Authentication code: 1151

Re: Picture flipped(mirror image) after conversion to Color TIFF - 25035150

Post by 246246 »

Both your input and output files has Orientation: RightTop (= 6) value.

Code: Select all

$ magick identify -verbose IMG_0233.jpg | grep -i orient
  Orientation: RightTop
    exif:Orientation: 6

$ magick identify -verbose 'Converted - 2019-06-21T115901.857.tiff' | grep -i orient
  Orientation: RightTop
Most viewer support orientation for JPEG but not for Tiff, that is the cause of the problem.
(If you see the files on Windows 7, both are rotated, because Windows 7 does not support orientation even for JPEG.)

So I suggest first rotate and/or flip the image to the stats of orientation = 1 (and set the orientation value to 1 or unset) somehow, then convert.
(From 6 to 1, rotate 90 degree clockwise. See https://magnushoff.com/jpeg-orientation.html for example.)

ImageMagick command line has -orient and -auto-orient option.

-auto-orient should do this work.
Ganesh_B
Posts: 13
Joined: 2018-03-06T05:29:40-07:00
Authentication code: 1152

Re: Picture flipped(mirror image) after conversion to Color TIFF - 25035150

Post by Ganesh_B »

Thanks a lot 246246, for detailed explanation and the info on blog post. It was much helpful.

Regards,
Ganesh.
Ganesh_B
Posts: 13
Joined: 2018-03-06T05:29:40-07:00
Authentication code: 1152

Re: Picture flipped(mirror image) after conversion to Color TIFF - 25035150

Post by Ganesh_B »

Thanks a lot 246246, for detailed explanation and the info on blog post. It was much helpful.

Regards,
Ganesh.
Post Reply