Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I tried manually implementing the Drupal 6 patch https://www.drupal.org/files/force_jpg-1557758-1_0.patch located in https://www.drupal.org/node/1557758 for Drupal 7. It didn't actually change the format of images, it just changes the extension. Any ideas on how to adapt this to Drupal 7?
Comments
Comment #1
Marvin Daugherty CreditAttribution: Marvin Daugherty commentedThis alters the image format after it is saved and leaves the extension as .png. The .png extension really doesn't matter as long as the MIME type is correct.
On line 518 just above '@chmod($image['destination'], 0664);' in /sites/all/modules/image_resize_filter/image_resize_filter.module, I stuck in...
If anyone has an improvement, I would be appreciative.
Comment #2
Marvin Daugherty CreditAttribution: Marvin Daugherty commentedImproved it so it checks the MIME format before replacing it with a JPEG. Also, tests for 'nojpg' in the file name for those times where you just have to have a transparency.
As always, comments are appreciated.