-
Notifications
You must be signed in to change notification settings - Fork 140
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
Can't load PNG, JPEG Images with scrimage-webp #245
Comments
Can you provide sample code with an image ?
…On Sat, 26 Feb 2022 at 09:57, Stanislav Migunov ***@***.***> wrote:
I need a scrimage-webp lib for compression, but if I use it, I can't load
png or jpg files via ImmutableImage.loader().fromBytes(receiveBytes)
The error I've got
[image: Screenshot 2022-02-23 at 21 33 25]
<https://user-images.githubusercontent.com/44321056/155849800-694efec5-49c5-46e4-8416-d2a6f22e88f3.png>
But if I'll remove the scrimage-webp, when everything is working fine
—
Reply to this email directly, view it on GitHub
<#245>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVSGX76JURPIBLGZALJC3U5DZ5ZANCNFSM5PNE63QA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Can you a) paste code so I can copy it, and b) make it standalone, and c)
include the offending image.
…On Sat, 26 Feb 2022 at 11:30, Stanislav Migunov ***@***.***> wrote:
Hi, @sksamuel <https://github.com/sksamuel>
[image: Screenshot 2022-02-26 at 20 30 01]
<https://user-images.githubusercontent.com/44321056/155853089-003e8c53-cd18-43df-8d24-f8e6eb382140.png>
—
Reply to this email directly, view it on GitHub
<#245 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVSGVHHHTL625HAPUEIWDU5EE5DANCNFSM5PNE63QA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@sksamuel
it doesn't work with any png or jpg image. |
This isn't a stand alone test. You say the issue is with scrimage, but in order for me to test this I have to setup an entire ktor build, and then use an external http client in order to send images in. What I've done instead is add a test to the webp module that loads the above image using the immutable image loader. It passes fine. So I guess the issue is external. But if you believe the issue is with the webp handler, then fork this repo, and make that Issue245 test fail like what your are seeing, then I should be able to fix whatever is up. One thing you can try is copying the input stream to a byte array, because it's probably being scanned twice. |
Okay, I will try. Thanks |
I know what you might be seeing. |
yes, using shadowJar |
You need to merge your service files inside maven or gradle when you build a shadow jar otherwise Java's service loader framework can't work properly as the files overwrite each other inside the final jar. This would cause a problem in any library that relies on service files. If you are using shadow jar in gradle see https://imperceptiblethoughts.com/shadow/configuration/merging/#merging-service-descriptor-files Or you can setup the image loader like this (be on the latest version) where you specify the readers manually: ImmutableImage.loader() |
@sksamuel the second part is working for me. Thanks for your help! |
We got there in the end :) |
I need a scrimage-webp lib for compression, but if I use it, I can't load png or jpg files via
ImmutableImage.loader().fromBytes(receiveBytes)
The error I've got
But if I'll remove the scrimage-webp, when everything is working fine
scrimage version 4.0.27.
OS: MacOS 11.6.2
AdoptOpenJDK 11
The text was updated successfully, but these errors were encountered: