Skip to content

When rotating, ajpegtran sometimes reduces resolution #6926

Description

@nicolas-raoul

Context: #6857 (comment)

Looking at this part of ajpegtran.c, the new Jpegtran-based rotation seems to set transformoption.trim = TRUE. This may reduce the resolution—for example, a 4000×3000 (with 16x16 MCU block size) image may become 2992×4000 after a 90° rotation.

When normal ajpegtran rotation would result in a loss of information, several solutions could be considered:

  1. Use EXIF rotation instead
  2. Pad the margin with black color to form full MCU blocks, and save these blocks with 100% quality
  3. Accept that the margin will be lost

I would be in favor of 1 (only in cases where there would be information loss).

Metadata

Metadata

Assignees

No one assigned

    Labels

    gsocGoogle Summer of Code

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions