Skip Navigation

[Resolved] Tiff Files in image field

This support ticket is created 4 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 4 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#1687833

Dear Madam or Sir,

I have defined a toolset post type including a custom image field. For some reason, when creating objects of that type in the backend, toolset does not allow me to insert .tiff files into that field, with the message tiffs are not correct images. The wordpress installation itself allows tiffs, I can insert them into the media folder. So it seems the toolset image field is restricted to png, jpg and so one. Is there a possibility to overcome this limitation? The site is for a Media Publisher context, and they need to manage and store tiff Files for their production workflow.

Any help would be welcome. Thank you very much in advance.

Robert

#1688557

Dear Robert,

Wordpress does not support tiff file by default, see WP document:
https://codex.wordpress.org/Uploading_Files

But you can use WP filter hook to add it, for example:

function my_myme_types($mime_types){
    $mime_types = array_merge($mime_types, array(
        'tif|tiff' => 'image/tiff'
    ));
    return $mime_types;
}
add_filter('upload_mimes', 'my_myme_types', 1, 1);

More help:
https://developer.wordpress.org/reference/hooks/upload_mimes/