cortex-lab / alyx

Database for experimental neuroscience laboratories
44 stars 11 forks source link

Support upload of animated GIFs via REST #862

Closed k1o0 closed 2 months ago

k1o0 commented 3 months ago

Animated GIFs are somehow converted to inanimate images when uploaded via REST, however this does not happen when they are uploaded via the admin interface web form. Supporting animated GIFs would be very useful for imaging snapshots.

mayofaulkner commented 3 months ago

Automatic resize implemented when uploading via REST, need a way to avoid this resize when GIF detected, still need to implement a check on size.

k1o0 commented 3 months ago

Here are the relevant files for the image upload in Alyx. If image_width is 'orig', the file isn't resized, so this could be solved by simply settings this in the REST query. You could try this out then make this an option in ibllib code. https://github.com/cortex-lab/alyx/blob/master/alyx/misc/models.py#L149-L168 https://github.com/cortex-lab/alyx/blob/master/alyx/misc/views.py#L126-L141 https://github.com/cortex-lab/alyx/blob/master/alyx/misc/serializers.py#L11-L47