At 3.18.3, this is my first experience with BLOB fields. I have created a standalone Geopackage table that contains a BLOB field (I'm not sure why Layer Properties calls it a QByteArray, but I'll save that question for another day...)
I open the table and edit, adding digital photographs (one .jpg per table row) to the BLOB field by right-clicking the dropdown triangle and selecting Embed File..., then browsing to the jpg's path location and selecting the file. I then save my edits:
When I switch the table to Form Vew, the images stored in the table can be viewed, which is very useful. However, some of the photos (about 20%) are rotated 90 degrees to the left (always to the left), as shown below. Additionally, one of the images (out of approximately 150) is rotated upside-down by 180 degrees.
All of the images rotated to the left happen to have been taken in portrait mode (but note that the majority of portrait-mode photos display correctly). The single upside-down photo was taken in landscape mode.
I cannot find any other pattern as to why these particular photos are rotated. The rotation can occur to different photographers, cameras, and dates. Sometimes the rotated photo is one of several taken at the same time and location - where the other photos in the sequence are not rotated.
Further, all of the rotated photos display correctly when viewed in Windows Paint or Irfanview!
Restarting QGIS does not solve the problem.
Why is this rotation happening, and how can it be prevented?