nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.9k stars 4.01k forks source link

[Bug]: Preview generation with Imaginary webp format intermittently improperly being "regenerated" #43878

Closed invario closed 6 months ago

invario commented 7 months ago

⚠️ This issue respects the following points: ⚠️

Bug description

Let me preface by saying that I realize that the move to Imaginary is intended to have "on the fly" preview generation and eliminate the use of pre-generation via the Preview Generator app. However, I find "on the fly" generation even with Imaginary to be unacceptably slow when swiftly browsing through my photo timeline with apps like Memories or Photos. SO, I wanted to still pre-generate thumbnails, but using Imaginary as the generator. In the process of doing so, I seem to have stumbled upon a potential bug.

I recently switched from using ImageMagick to Imaginary for a preview generation at the advice of someone's forum post. Also, it's supposedly faster than ImageMagick. I wiped out the entire "appdata/preview" folder followed with a long process of "occ files:scan-app-data" to update the database. With all the previews wiped out, I executed "occ preview:generate-all" which proceeded to iterate through all the folders and generate previews.

The process got interrupted, so I restart it. To my surprise, instead of quickly skipping through the files it already processed, it seemed to be generating the preview again. Interesting...

I began troubleshooting things. First, I selected (3) files and placed it into its own folder. Then I did a "occ preview:generate-all -path=/mypath". Simultaneously, I was monitoring the output of imaginary. I saw the (3) POST requests to Imaginary, which appeared to be correct.

Additionally, here are the files that were generated based on the square/width/height sizes I had preconfigured:

find . -name "*.*" -exec ls -l {} \;

-rw-r--r--  1 www  www  165230 Feb 27 15:55 ./2/7/2/5/a/9/d/6521437/256-341.png
-rw-r--r--  1 www  www  10779 Feb 27 15:55 ./2/7/2/5/a/9/d/6521437/64-64-crop.png
-rw-r--r--  1 www  www  1628990 Feb 27 15:55 ./2/7/2/5/a/9/d/6521437/1024-1365.png
-rw-r--r--  1 www  www  101336 Feb 27 15:55 ./2/7/2/5/a/9/d/6521437/192-256.png
-rw-r--r--  1 www  www  1032707 Feb 27 15:55 ./2/7/2/5/a/9/d/6521437/768-1024.png
-rw-r--r--  1 www  www  161060 Feb 27 15:55 ./2/7/2/5/a/9/d/6521437/1536-2048-max.webp
-rw-r--r--  1 www  www  95214 Feb 27 15:55 ./9/7/7/e/c/9/d/6521436/256-192.png
-rw-r--r--  1 www  www  9949 Feb 27 15:55 ./9/7/7/e/c/9/d/6521436/64-64-crop.png
-rw-r--r--  1 www  www  159090 Feb 27 15:55 ./9/7/7/e/c/9/d/6521436/341-256.png
-rw-r--r--  1 www  www  1354968 Feb 27 15:55 ./9/7/7/e/c/9/d/6521436/1024-768.png
-rw-r--r--  1 www  www  2228105 Feb 27 15:55 ./9/7/7/e/c/9/d/6521436/1365-1024.png
-rw-r--r--  1 www  www  483236 Feb 27 15:55 ./9/7/7/e/c/9/d/6521436/2048-1536-max.webp
-rw-r--r--  1 www  www  113848 Feb 27 15:55 ./4/1/5/3/5/8/e/6521189/960-1280-max.webp
-rw-r--r--  1 www  www  139413 Feb 27 15:55 ./4/1/5/3/5/8/e/6521189/256-341.png
-rw-r--r--  1 www  www  991703 Feb 27 15:55 ./4/1/5/3/5/8/e/6521189/768-1024.png
-rw-r--r--  1 www  www  80732 Feb 27 15:55 ./4/1/5/3/5/8/e/6521189/192-256.png
-rw-r--r--  1 www  www  8135 Feb 27 15:55 ./4/1/5/3/5/8/e/6521189/64-64-crop.png

Generation appeared to be correct. However, re-executing the same "occ preview:generate-all -path=/mypath" now yields this:

-rw-r--r--  1 www  www  165230 Feb 27 15:58 ./2/7/2/5/a/9/d/6521437/256-341.png
-rw-r--r--  1 www  www  10779 Feb 27 15:58 ./2/7/2/5/a/9/d/6521437/64-64-crop.png
-rw-r--r--  1 www  www  1628990 Feb 27 15:58 ./2/7/2/5/a/9/d/6521437/1024-1365.png
-rw-r--r--  1 www  www  101336 Feb 27 15:58 ./2/7/2/5/a/9/d/6521437/192-256.png
-rw-r--r--  1 www  www  1032707 Feb 27 15:58 ./2/7/2/5/a/9/d/6521437/768-1024.png
-rw-r--r--  1 www  www  161060 Feb 27 15:55 ./2/7/2/5/a/9/d/6521437/1536-2048-max.webp
-rw-r--r--  1 www  www  95214 Feb 27 15:58 ./9/7/7/e/c/9/d/6521436/256-192.png
-rw-r--r--  1 www  www  9949 Feb 27 15:58 ./9/7/7/e/c/9/d/6521436/64-64-crop.png
-rw-r--r--  1 www  www  159090 Feb 27 15:58 ./9/7/7/e/c/9/d/6521436/341-256.png
-rw-r--r--  1 www  www  1354968 Feb 27 15:58 ./9/7/7/e/c/9/d/6521436/1024-768.png
-rw-r--r--  1 www  www  2228105 Feb 27 15:58 ./9/7/7/e/c/9/d/6521436/1365-1024.png
-rw-r--r--  1 www  www  483236 Feb 27 15:55 ./9/7/7/e/c/9/d/6521436/2048-1536-max.webp
-rw-r--r--  1 www  www  113848 Feb 27 15:55 ./4/1/5/3/5/8/e/6521189/960-1280-max.webp
-rw-r--r--  1 www  www  139413 Feb 27 15:58 ./4/1/5/3/5/8/e/6521189/256-341.png
-rw-r--r--  1 www  www  991703 Feb 27 15:58 ./4/1/5/3/5/8/e/6521189/768-1024.png
-rw-r--r--  1 www  www  80732 Feb 27 15:58 ./4/1/5/3/5/8/e/6521189/192-256.png
-rw-r--r--  1 www  www  8135 Feb 27 15:58 ./4/1/5/3/5/8/e/6521189/64-64-crop.png

Note the updated timestamp on the PNG preview files but not the WEBP files... Even stranger, I find that those previews are NOT generated via Imaginary since no POSTs are ever sent to the Imaginary server.

Where are these PNG files being generated from?

It gets even more confusing because if I load up my NC page and browse the folder with the 3 files, the files seem to be regenerated, AGAIN. When doing it this way, regeneration seems to be intermittent.

-rw-r--r--  1 www  www  165230 Feb 27 15:58 ./2/7/2/5/a/9/d/6521437/256-341.png
-rw-r--r--  1 www  www  10779 Feb 27 16:02 ./2/7/2/5/a/9/d/6521437/64-64-crop.png
-rw-r--r--  1 www  www  1628990 Feb 27 15:58 ./2/7/2/5/a/9/d/6521437/1024-1365.png
-rw-r--r--  1 www  www  101336 Feb 27 15:58 ./2/7/2/5/a/9/d/6521437/192-256.png
-rw-r--r--  1 www  www  1032707 Feb 27 15:58 ./2/7/2/5/a/9/d/6521437/768-1024.png
-rw-r--r--  1 www  www  161060 Feb 27 15:55 ./2/7/2/5/a/9/d/6521437/1536-2048-max.webp
-rw-r--r--  1 www  www  95214 Feb 27 15:58 ./9/7/7/e/c/9/d/6521436/256-192.png
-rw-r--r--  1 www  www  9949 Feb 27 16:02 ./9/7/7/e/c/9/d/6521436/64-64-crop.png
-rw-r--r--  1 www  www  159090 Feb 27 15:58 ./9/7/7/e/c/9/d/6521436/341-256.png
-rw-r--r--  1 www  www  1354968 Feb 27 15:58 ./9/7/7/e/c/9/d/6521436/1024-768.png
-rw-r--r--  1 www  www  2228105 Feb 27 15:58 ./9/7/7/e/c/9/d/6521436/1365-1024.png
-rw-r--r--  1 www  www  483236 Feb 27 15:55 ./9/7/7/e/c/9/d/6521436/2048-1536-max.webp
-rw-r--r--  1 www  www  113848 Feb 27 15:55 ./4/1/5/3/5/8/e/6521189/960-1280-max.webp
-rw-r--r--  1 www  www  139413 Feb 27 15:58 ./4/1/5/3/5/8/e/6521189/256-341.png
-rw-r--r--  1 www  www  991703 Feb 27 15:58 ./4/1/5/3/5/8/e/6521189/768-1024.png
-rw-r--r--  1 www  www  80732 Feb 27 15:58 ./4/1/5/3/5/8/e/6521189/192-256.png
-rw-r--r--  1 www  www  8135 Feb 27 16:02 ./4/1/5/3/5/8/e/6521189/64-64-crop.png

Note the updated timestamps on the 64x64 thumbnails that the Files browser app requested. Again, why, and how? What is generating this?

Here's a snippet from my config.php:

  'enable_previews' => true,
  'enabledPreviewProviders' =>
  array (
    0 => 'OC\\Preview\\Imaginary',
    1 => 'OC\\Preview\\MKV',
    2 => 'OC\\Preview\\MP3',
    3 => 'OC\\Preview\\MP4',
    4 => 'OC\\Preview\\TXT',
    5 => 'OC\\Preview\\AVI',
    6 => 'OC\\Preview\\Movie',
  ),
  'preview_format' => 'webp',
   'preview_imaginary_url' => 'http://127.0.0.1:8088',

And honestly, I'm wondering why PNG is being generated at all by NC. And again, no new POSTS to my Imaginary server.

I even removed the imagick.so PHP plugin and restarted php-fpm to ensure it wasn't being used. It wasn't.

This behavior does NOT happen when the "preview_format" option is switched to "jpeg".

Can anyone shed some light on this? It seems to be that NC is somehow re-generating previews for my files in PNG format. I have even removed all preview providers from my config.php with no success. It seems like something somewhere is preventing NC from recognizing that PNG previews are in the folder already? No idea how the PNG files even came to exist.

Thanks in advance to anyone.

Steps to reproduce

  1. Install imaginary and ensure the server is operational
  2. Configure NC to use it
  3. Change preview type to "webp"
  4. Use NC as normal to generate previews OR generate previews via preview generator

Expected behavior

Previews should only be generated once.

Installation method

Community Manual installation with Archive

Nextcloud Server version

28

Operating system

Other

PHP engine version

PHP 8.2

Web server

Nginx

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

Configuration report

{
    "system": {
        "apps_paths": [
            {
                "path": "\/usr\/local\/www\/nextcloud\/apps",
                "url": "\/apps",
                "writable": true
            }
        ],
        "defaultapp": "memories",
        "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
        "loglevel": 2,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0
        },
        "filelocking.enabled": true,
        "trusted_domains": [
            "localhost",
            "192.168.0.12",
            "nextcloud.MYDOMAIN.com"
        ],
        "default_phone_region": "US",
        "enable_previews": true,
        "enabledPreviewProviders": [
            "OC\\Preview\\Imaginary",
            "OC\\Preview\\MKV",
            "OC\\Preview\\MP3",
            "OC\\Preview\\MP4",
            "OC\\Preview\\TXT",
            "OC\\Preview\\AVI",
            "OC\\Preview\\Movie"
        ],
        "preview_format": "webp",
        "preview_imaginary_url": "***REMOVED SENSITIVE VALUE***",
        "cropimagepreviews": "0",
        "preview_max_x": 2048,
        "preview_max_y": 2048,
        "jpeg_quality": "60",
        "logtimezone": "America\/New_York",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "version": "28.0.2.5",
        "updater.release.channel": "stable",
        "overwrite.cli.url": "https:\/\/nextcloud.*MYDOMAIN*.com",
        "dbtype": "mysql",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpsecure": "ssl",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "maintenance": false,
        "trashbin_retention_obligation": "30,31",
        "theme": "",
        "app_install_overwrite": [
            "customproperties"
        ],
        "memories.vod.path": "\/usr\/local\/www\/nextcloud\/apps\/memories\/bin-ext\/go-vod-amd64",
        "memories.vod.ffmpeg": "\/usr\/local\/bin\/ffmpeg",
        "memories.vod.ffprobe": "\/usr\/local\/bin\/ffprobe",
        "memories.exiftool": "\/usr\/local\/bin\/exiftool",
        "memories.gis_type": 1,
        "data-fingerprint": "cf5cf1b31d5af06404c30a5805d00eda",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "memories.exiftool_no_local": true,
        "memories.vod.external": true,
        "maintenance_window_start": 8
    }
}

List of activated Apps

Enabled:
  - activity: 2.20.0
  - admin_audit: 1.18.0
  - bruteforcesettings: 2.8.0
  - cloud_federation_api: 1.11.0
  - dav: 1.29.1
  - federatedfilesharing: 1.18.0
  - files: 2.0.0
  - files_external: 1.20.0
  - files_pdfviewer: 2.9.0
  - files_reminders: 1.1.0
  - files_sharing: 1.20.0
  - files_trashbin: 1.18.0
  - logreader: 2.13.0
  - lookup_server_connector: 1.16.0
  - memories: 6.2.2
  - notifications: 2.16.0
  - oauth2: 1.16.3
  - password_policy: 1.18.0
  - photos: 2.4.0
  - previewgenerator: 5.4.0
  - privacy: 1.12.0
  - provisioning_api: 1.18.0
  - related_resources: 1.3.0
  - serverinfo: 1.18.0
  - settings: 1.10.1
  - sharebymail: 1.18.0
  - survey_client: 1.16.0
  - theming: 2.3.0
  - twofactor_admin: 4.4.0
  - twofactor_backupcodes: 1.17.0
  - twofactor_totp: 10.0.0-beta.2
  - updatenotification: 1.18.0
  - viewer: 2.2.0
  - workflowengine: 2.10.0
Disabled:
  - circles: 28.0.0-dev (installed 22.1.1)
  - comments: 1.18.0 (installed 1.10.0)
  - contactsinteraction: 1.9.0 (installed 1.1.0)
  - dashboard: 7.8.0 (installed 7.0.0)
  - encryption: 2.16.0
  - federation: 1.18.0 (installed 1.10.1)
  - files_versions: 1.21.0 (installed 1.13.0)
  - firstrunwizard: 2.17.0 (installed 2.13.0)
  - nextcloud_announcements: 1.17.0 (installed 1.9.0)
  - recommendations: 2.0.0 (installed 1.3.0)
  - support: 1.11.0 (installed 1.3.0)
  - suspicious_login: 6.0.0 (installed 4.3.0)
  - systemtags: 1.18.0 (installed 1.10.0)
  - text: 3.9.1 (installed 3.5.1)
  - user_ldap: 1.19.0
  - user_status: 1.8.1 (installed 1.0.1)
  - weather_status: 1.8.0 (installed 1.0.0)

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

Nothing notable in the log pertaining to this.  No errors are thrown.

Additional info

Nextcloud Hub 7 (28.0.2) FreeBSD 13.2-RELEASE via iocage jail in TrueNAS Core 13.0-U6.1 PHP and PHP-FPM 8.2.14 Imaginary cloned and compiled from Github https://github.com/h2non/imaginary

invario commented 7 months ago

Strike that, here are some relevant logs generated in loglevel 0. These entries result from refreshing loading the page in the browser Memories app.

{"reqId":"qkwqS4AsgwMICtN1K35i","level":1,"time":"2024-02-27T18:13:55-05:00","remoteAddr":"192.168.0.75","user":"invar","app":"core","method":"GET","url":"/apps/memories/api/image/preview/6521189?c=83e1f6f6c50556a0733c116eb71ecf4d&x=340&y=340&a=1","message":"OC_Image->data. Could not guess mime-type, defaulting to png","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36","version":"28.0.2.5","data":{"app":"core"}}
{"reqId":"voPUzTzPhhlRWp3B8GBf","level":1,"time":"2024-02-27T18:13:55-05:00","remoteAddr":"192.168.0.75","user":"invar","app":"core","method":"GET","url":"/apps/memories/api/image/preview/6521437?c=5e08a311b5c4426d5368d5edb92714dc&x=340&y=340&a=1","message":"OC_Image->data. Could not guess mime-type, defaulting to png","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36","version":"28.0.2.5","data":{"app":"core"}}
{"reqId":"OeHIven2I7aEe6uQ0GJu","level":1,"time":"2024-02-27T18:13:55-05:00","remoteAddr":"192.168.0.75","user":"invar","app":"core","method":"GET","url":"/apps/memories/api/image/preview/6521436?c=f3ea517e36570ea609dd7d005b77e8c8&x=340&y=340&a=1","message":"OC_Image->data. Could not guess mime-type, defaulting to png","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36","version":"28.0.2.5","data":{"app":"core"}}
{"reqId":"jrRizPT2O107VHbZsREQ","level":1,"time":"2024-02-27T18:14:42-05:00","remoteAddr":"192.168.0.75","user":"invar","app":"core","method":"POST","url":"/apps/memories/api/image/multipreview","message":"OC_Image->data. Could not guess mime-type, defaulting to png","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36","version":"28.0.2.5","data":{"app":"core"}}
{"reqId":"jrRizPT2O107VHbZsREQ","level":1,"time":"2024-02-27T18:14:43-05:00","remoteAddr":"192.168.0.75","user":"invar","app":"core","method":"POST","url":"/apps/memories/api/image/multipreview","message":"OC_Image->data. Could not guess mime-type, defaulting to png","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36","version":"28.0.2.5","data":{"app":"core"}}
{"reqId":"jrRizPT2O107VHbZsREQ","level":1,"time":"2024-02-27T18:14:43-05:00","remoteAddr":"192.168.0.75","user":"invar","app":"core","method":"POST","url":"/apps/memories/api/image/multipreview","message":"OC_Image->data. Could not guess mime-type, defaulting to png","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36","version":"28.0.2.5","data":{"app":"core"}}

And here it is in the Files app:

{"reqId":"7Kn6jbesFCCtLpdjASTf","level":1,"time":"2024-02-27T18:18:47-05:00","remoteAddr":"192.168.0.75","user":"invar","app":"core","method":"GET","url":"/core/preview?fileId=6521189&x=32&y=32&mimeFallback=true&a=0","message":"OC_Image->data. Could not guess mime-type, defaulting to png","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36","version":"28.0.2.5","data":{"app":"core"}}
{"reqId":"J7gxCnoSfJ4EMaH2DygZ","level":1,"time":"2024-02-27T18:18:47-05:00","remoteAddr":"192.168.0.75","user":"invar","app":"core","method":"GET","url":"/core/preview?fileId=6521436&x=32&y=32&mimeFallback=true&a=0","message":"OC_Image->data. Could not guess mime-type, defaulting to png","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36","version":"28.0.2.5","data":{"app":"core"}}
{"reqId":"WCOwjmPkCjBWoZEzvJLl","level":1,"time":"2024-02-27T18:18:47-05:00","remoteAddr":"192.168.0.75","user":"invar","app":"core","method":"GET","url":"/core/preview?fileId=6521437&x=32&y=32&mimeFallback=true&a=0","message":"OC_Image->data. Could not guess mime-type, defaulting to png","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36","version":"28.0.2.5","data":{"app":"core"}}

And from "occ preview:generate=all -path=/mypath"

{"reqId":"NhjZAO6HnuqQZDteLZuW","level":1,"time":"2024-02-27T18:20:14-05:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"OC_Image->data. Could not guess mime-type, defaulting to png","userAgent":"--","version":"28.0.2.5","data":{"app":"core"}}
{"reqId":"NhjZAO6HnuqQZDteLZuW","level":1,"time":"2024-02-27T18:20:14-05:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"OC_Image->data. Could not guess mime-type, defaulting to png","userAgent":"--","version":"28.0.2.5","data":{"app":"core"}}
{"reqId":"NhjZAO6HnuqQZDteLZuW","level":1,"time":"2024-02-27T18:20:15-05:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"OC_Image->data. Could not guess mime-type, defaulting to png","userAgent":"--","version":"28.0.2.5","data":{"app":"core"}}
{"reqId":"NhjZAO6HnuqQZDteLZuW","level":1,"time":"2024-02-27T18:20:15-05:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"OC_Image->data. Could not guess mime-type, defaulting to png","userAgent":"--","version":"28.0.2.5","data":{"app":"core"}}
{"reqId":"NhjZAO6HnuqQZDteLZuW","level":1,"time":"2024-02-27T18:20:15-05:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"OC_Image->data. Could not guess mime-type, defaulting to png","userAgent":"--","version":"28.0.2.5","data":{"app":"core"}}
{"reqId":"NhjZAO6HnuqQZDteLZuW","level":1,"time":"2024-02-27T18:20:16-05:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"OC_Image->data. Could not guess mime-type, defaulting to png","userAgent":"--","version":"28.0.2.5","data":{"app":"core"}}
{"reqId":"NhjZAO6HnuqQZDteLZuW","level":1,"time":"2024-02-27T18:20:16-05:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"OC_Image->data. Could not guess mime-type, defaulting to png","userAgent":"--","version":"28.0.2.5","data":{"app":"core"}}
{"reqId":"NhjZAO6HnuqQZDteLZuW","level":1,"time":"2024-02-27T18:20:17-05:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"OC_Image->data. Could not guess mime-type, defaulting to png","userAgent":"--","version":"28.0.2.5","data":{"app":"core"}}
{"reqId":"NhjZAO6HnuqQZDteLZuW","level":1,"time":"2024-02-27T18:20:17-05:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"OC_Image->data. Could not guess mime-type, defaulting to png","userAgent":"--","version":"28.0.2.5","data":{"app":"core"}}
{"reqId":"NhjZAO6HnuqQZDteLZuW","level":1,"time":"2024-02-27T18:20:18-05:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"OC_Image->data. Could not guess mime-type, defaulting to png","userAgent":"--","version":"28.0.2.5","data":{"app":"core"}}
{"reqId":"NhjZAO6HnuqQZDteLZuW","level":1,"time":"2024-02-27T18:20:18-05:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"OC_Image->data. Could not guess mime-type, defaulting to png","userAgent":"--","version":"28.0.2.5","data":{"app":"core"}}
{"reqId":"NhjZAO6HnuqQZDteLZuW","level":1,"time":"2024-02-27T18:20:18-05:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"OC_Image->data. Could not guess mime-type, defaulting to png","userAgent":"--","version":"28.0.2.5","data":{"app":"core"}}
{"reqId":"NhjZAO6HnuqQZDteLZuW","level":1,"time":"2024-02-27T18:20:18-05:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"OC_Image->data. Could not guess mime-type, defaulting to png","userAgent":"--","version":"28.0.2.5","data":{"app":"core"}}
{"reqId":"NhjZAO6HnuqQZDteLZuW","level":1,"time":"2024-02-27T18:20:18-05:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","message":"OC_Image->data. Could not guess mime-type, defaulting to png","userAgent":"--","version":"28.0.2.5","data":{"app":"core"}}
invario commented 7 months ago

No one else can confirm this?

It seems to me that anyone on imaginary and generating webp would take a pretty huge performance hit from constantly regenerating previews unnecessarily.

invario commented 6 months ago

Wondering if it had to do with how #38032 was implemented....

st3iny commented 6 months ago

You are right. The current implementation might be broken as the corresponding switch has not been added to OC_Image yet. It tries to decode the image data and falls back to png.

https://github.com/nextcloud/server/blob/9d70fd3e64b60a316a03fb2b237891380c310c58/lib/private/legacy/OC_Image.php#L381-L398

invario commented 6 months ago

Thank you! Going to test this out now.

invario commented 6 months ago

CONFIRMED appears to be working on NC 28.0.3 with this new OC_Image.php in place. Previews are no longer being regenerated and PNGs aren't either.

Thank you!!