New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some images generated with imaginary are incorrect #323
Comments
I see, that you are persistent. I'll try to reproduce it. However, I suspect this being either a bug in the server or the imaginary upstream. |
@janusn which Imaginary version are you running? |
Can you for a test check if it works with the |
@szaimen The version of imaginary is 1.2.4. |
Yeah, so to make it work correctly, it is required to build imaginary from master IIRC since no new release was pushed since two years. That is what we are doing with the |
@szaimen Thanks for the pointer. I have replaced the container from the image h2non/imaginary:latest with the image nextcloud/aio-imaginary:latest. Unfortunately, it still produces strange distorted previews. In fact, you can see the previews of the build-in stock photos generated from aio-imaginary are distorted, such as
but the previews of the following photos are correct:
The version of the aio-imaginary:
|
Right. Then maybe @CarlSchwan has an idea? |
I only enabled the Imaginary provider to be able to isolate the issue. I'm currently investigating the server code to find a difference between both calls to the Preview API. EDIT: I repeated the procedure multiple times and now all previews are broken. It seems that only the first previews ever generated are fine. After that, all previews are weird, even when I restart the Imaginary server. |
If I remember the discussion with Carl correctly, the maintainer of Imaginary submitted in the last moment a commit that broke something. Not sure if it is the same issue though. Probably it is then this: h2non/imaginary@234d1fe |
I tested some more and noticed that the previews are only broken if the source image is smaller than the actual preview. E.g. Supplying an Image with 8000x6000 produces correct results. Supplying an image with 640x480 produces weird results because Nextcloud asks for a preview of 1024x1024. |
Bingo! @szaimen This is correct. I added debugging code to Imaginary which dumps each generated image to a file and they are correct. It seems like our server does not parse the width and height values correctly and thus distorts the image. This should be fixable by parsing both headers. |
Indeed but only if the header was specified to be emitted, correct? |
So rather fail if one of these headers was not found instead of generating false previews? |
Yes, but I came up with a workaround. The image is now parsed when width and height are not specified. This has a minor performance impact but there is no way around it. We need to have the exact width and height values or previews will be distorted. I'm also planning to amend the documentation with a warning to alert admins to use the |
Sounds good! :) |
I'll also link to the aio docker image of Imaginary because the default one is outdated and doesn't include the flag ... |
Fine by me 👍 |
However I am thjnking about tweaking the container so that |
Great idea! |
Let me have a look at this then :) |
Should we improve the docs on this? Shall I do or will you do @st3iny ? :) |
For the document, please mention the registry "nextcloud/aio-imaginary". Otherwise people like me will still get the wrong image. Thanks a ton! |
Yes, will do. Thanks for bringing this up! |
@szaimen Thanks. I have forgotten to mention. It is better to give the imaginary a real version number to be returned by the following command as well. It is much easier to report any bug on it. |
I see, however since this is built staight from their github source code, I don't know how to apply that change... |
I'm on it. |
Ref nextcloud/previewgenerator#323 Ref nextcloud/server#35105 Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
Thanks! :) |
Ref nextcloud/previewgenerator#323 Ref nextcloud/server#35105 Co-authored-by: Simon L. <szaimen@e.mail.de> Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
Ref nextcloud/previewgenerator#323 Ref nextcloud/server#35105 Co-authored-by: Simon L. <szaimen@e.mail.de> Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
Ref nextcloud/previewgenerator#323 Ref nextcloud/server#35105 Co-authored-by: Simon L. <szaimen@e.mail.de> Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
Some square preview images generated with command
$ occ preview:generate-all -vvv
are a crop of the original images and the aspect ratio are not preserved.
On the other hand, the square preview images generated by web interface of Nextcloud are correctly. They respect the aspect ratios and letterboxed correctly.
Environment:
The content of the config.php:
The previewgenerator settings:
A sample of an original image:
The preview generated for both grid view and detailed view on the Files pane.
Another example of an original image:
The preview generated for both grid view and detailed view on the Files pane.
The text was updated successfully, but these errors were encountered: