• Resolved MarcGuay

    (@marcguay)


    With the replace option enabled, the replace function returns exits the first test because the file type is application/octet-stream rather than image/heic. Searching the internet I see a lot of discussion around this issue and how it might be related to something at the OS level.

    • This topic was modified 1 year, 1 month ago by MarcGuay.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter MarcGuay

    (@marcguay)

    Perhaps using wp_check_filetype_and_ext would be more reliable rather than using $file[‘type’] directly.

    • This reply was modified 1 year, 1 month ago by MarcGuay.
    Thread Starter MarcGuay

    (@marcguay)

    I changed the code to the following and it’s now working for me:

    // Is this image even an heic?
    $wp_filetype = wp_check_filetype_and_ext( $file['tmp_name'], $file['name']);
    if ( empty( $wp_filetype['type'] ) || 'image/heic' !== $wp_filetype['type'] ) {...
    • This reply was modified 1 year, 1 month ago by MarcGuay.
    Plugin Author Corey Salzano

    (@salzano)

    Thanks for the feedback, Marc! I’ll look into this change.

    I can confirm the same issue and that the revised code by @marcguay temporarily fixes the replace issue. Looking forward to the permanent fix in the plugin. Thanks!

    Plugin Author Corey Salzano

    (@salzano)

    Awesome, thanks for the +1. I’ll get a new version tested and released this week or next.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Replace does not work because of file type’ is closed to new replies.