Image embeds: large portrait photograph gets embedded in landscape mode

I took a few photos with my phone and embedded them in Obsidian. The photos were taken in portrait mode, but Obsidian embeds them as landscape.

Steps to reproduce

Embed a photograph taken in portrait mode.
Open the preview.

Expected result

Keep the original photo mode.

Actual result

Images get shown in landscape mode.

Environment

  • Operating system: Windows 10
  • Obsidian version: 0.6.7
  • Using custom CSS: No

Additional information

If I use the original photo, without any edits, it gets embedded as landscape. I wanted to see if things change if I edit it so I opened it in Photoshop and saved a copy of the same file. This embeds it in portrait mode. Probably Photoshop removes the EXIF orientation metadata in the process.

1 Like

Steps to reproduce

Without checking the size of the image, drag the first image you can pick up from Finder to a new note in the Obsidian markdown panel. Especially if you know, for sure, that’s an image of high-quality. Check if the file was added properly to the File Explorer panel. Split the note view vertically. It should open the same note on the right side. And choose to show in the preview mode.

Expected result

Regardless of the size of the image, the photo should be loaded in the same way and orientation as it appears in the Finder preview.

Actual result

After testing with at least 5 different images, but of similar sizes and resolutions, they all appeared as if they were lying on the left side. Horizontally-oriented, instead of vertically as we should expect.

Environment

  • Operating system: macOS Catalina 10.15.5
  • Obsidian version: v. 0.6.5
  • Using custom CSS: None.

Additional information

Since I was suspecting that it was something related to the image resolution, I did a test with a smaller image and everything went as expected. I imagine that after a certain size, the images appear in an unexpected way.

Here is a screenshot of a high-res photo added to a note. 2448 Ă— 3264 with 2mb.

Here is a screenshot of a low-res photo/image added to a note. 412x330 with 41k.

I hope this bug report will be useful understand what may be causing this unwanted image behaviour.

@newts: @danielvoicu seems to have figured out the root cause (see his “Additional information” section).

Thanks to you both!

1 Like

I’m not sure why this is in graveyard.

If a photo is taken in portrait mode, it should be displayed in portrait mode, not landscape.
Shouldn’t be impacted by image size - most images now are initially large.

Easiest solution is probably to add a rotate feature.

Check the whole thread
@Dor it’s not an issue of image size. It’s a matter of metadata being stripped by some photoediting software.

I did.

This says that original portrait photo is displayed as landscape.
Only after opening in Photoshop is it correctly in portrait mode.

I haven’t tested in Photoshop but this otherwise matches my own experience.
Photo shown correctly in file explorer, but sideways in Obsidian.

I’ll move this back to bug reports

Do you still have this problem in 0.8.5?

I’ve not embedded an image for a while, but all my old images are now correctly in portrait mode.

I’ve embedded two “portrait” photos and both are put in landscape mode.