Hi, I guess I need to dig this subject up :)
AVIFs are quite new so I wasn't sure if Gallery3 would ever work with it,
I've been trying the exact same thing, and I can't make it work.
However, I couldn't find any "if" statement on lines 57-58 of Image.php so I assume you meant these lines - 96-97?
if ( ! isset(Image::$allowed_types[$image_info[2]]))
throw new Kohana_Exception('The specified image, :type:, is not an allowed image type.', array(':type:' => $image));
Still, commenting these lines out didn't help, and I suspect the issue on my system lies deeper in the code or in underlying libraries.
The error in the logs does not seem to indicate it hits this exception.
In fact the same procedure was used by Brad years ago to add support for WebP images and they work just fine, even WebP animations.
I've tried disabling all modules as well in case the problem was caused there, it didn't help.
Some info about the system:
PHP Version 8.1.34 (old...)
Debian 6.1.140-1 (2025-05-22) x86_64
nginx/1.22.1 (Problem might lie there but it works for all other image types)
Imagick 3.8.1, AVIF listed under supported formats
GD 2.3.3 (not used), AVIF Support is enabled
The main problem here is that this is a shared system (
sdf.org), so I can't really update anything myself without nagging the admins and they are really slow.
The error received in the log related to "ORM Validation" but I'm way out of my depth when it comes to this stuff...
2026-03-07 12:46:51 +01:00 --- error: ORM Validation has failed for items model
#0 /gallery/system/libraries/ORM.php(755): ORM_Validation_Exception_Core::handle_validation()
#1 /gallery/modules/gallery/models/item.php(900): ORM_Core->validate()
#2 /gallery/system/libraries/ORM.php(778): Item_Model_Core->validate()
#3 /gallery/modules/gallery/libraries/MY_ORM.php(34): ORM_Core->save()
#4 /gallery/modules/gallery/libraries/ORM_MPTT.php(76): ORM->save()
#5 /gallery/modules/gallery/models/item.php(397): ORM_MPTT_Core->save()
#6 /gallery/modules/gallery/controllers/uploader.php(192): Item_Model_Core->save()
#7 /gallery/modules/gallery/controllers/uploader.php(62): Uploader_Controller->_add_item()
#8 [internal function]: Uploader_Controller->add_photo()
#9 /gallery/system/core/Kohana.php(302): ReflectionMethod->invokeArgs()
#10 /gallery/system/core/Event.php(208): Kohana_Core::instance()
#11 /gallery/application/Bootstrap.php(67): Event_Core::run()
#12 /gallery/index.php(124): require('...')
#13 {main}
2026-03-07 12:46:51 +01:00 --- error: Validation errors: Array
(
[mime_type] => invalid
[name] => invalid_data_file
)
It IS able to extract the thumbnail during the upload, so I'm assuming the ImageMagick library does that correctly.
Hope someone has some idea :)
regards,
Stian