Closed invario closed 6 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"}}
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.
Wondering if it had to do with how #38032 was implemented....
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.
Thank you! Going to test this out now.
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!!
⚠️ 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:
Generation appeared to be correct. However, re-executing the same "occ preview:generate-all -path=/mypath" now yields this:
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.
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:
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
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
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
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