Photo rotates after changing aspect ratio

Describe the problem/error/question

I am trying to change the aspect ratio of an image from google drive and because of the metadata in the photo when I change the aspect ratio of the picture it rotates. How can I fix this without 3rd party intervention

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 2.2.6
  • Database default
  • n8n EXECUTIONS_PROCESS setting default
  • Running n8n via Docker desktop
  • Operating system: windows

Command in FFmpeg node

-i {input} -vf scale=900:1350:force_original_aspect_ratio=increase,crop=900:1350 -vframes 1 -q:v 2 -map_metadata -1 -f image2 {output}

Hi @Jeron_LeDoux ,
You can use the n8n built-in Edit Image node to do this.

So far using the edit image node it has multiple inconsistencies when it comes to cropping pictures that have varying aspect ratios. Such as landscape vs portrait. If you know a way to smoothly resize and crop images no matter their original aspect ratio with the main subject in frame I’m open to suggestions. Main subject usually in the middle of the picture.

1 Like

even after using the edit image node if the photo has metadata then it flips width and height

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.