I noticed that for some large images, after the file is rotated and saved, the file size changes, it usually shrinks (10 MB => 2 MB). If you look at the file_save
function the file size is calculated early in the process before presave hooks are called. So therefore the wrong file size is stored in the database.
This is not a major problem as the default file download functions get the file size from the stored file in the file system and not the database but the module Media Gallery uses the file size from the database. The problem for media gallery, is that when downloading the file, the file fails to download because the Content-Length passed to the browser is larger than the actual content being streamed.
1. Upload a large file that has EXIF orientation metadata that rotates it.
2. Compare the file size in the database to the file size stored on the file system.
Re-calculate the file size after rotation function is called.
Provide a patch - submitted.
Active
1.0
Code