-
Notifications
You must be signed in to change notification settings - Fork 139
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
Repeated Gif convertation fails with "unexpected EOF" #643
Comments
Sorry for the super late reply. I was on vacation, then came back and
immediately had to move to a new house & office.
I only see a single resize step here. Is there more code?
…On Tue, Jun 8, 2021, 8:53 AM Pavel Eroshkin ***@***.***> wrote:
Hello!
Steps to reproduce:
1. Resize some gif image
2. Resize output from first step
Example gif:
https://media2.giphy.com/media/BLjVY7KIN1fYLLvkLh/giphy.gif?cid=ecf05e472d5ea09f14d415d582fe28c7665c258b75644605&rid=giphy.gif&ct=g
Example code:
public class Test
{
public async Task<byte[]> ConvertAsync(byte[] image)
{
using var imageSource = new BytesSource(image);
using var job = new ImageJob();
var node = job.Decode(
imageSource,
new DecodeCommands().SetIgnoreColorProfileErrors(true)
);
await using var resultStream = new MemoryStream();
await node.Constrain(new Constraint(200, 100))
.EncodeToStream(resultStream, false, new GifEncoder())
.Finish()
.InProcessAsync()
.ConfigureAwait(false);
return resultStream.ToArray();
}
public async Task Test(byte[] gif)
{
var converted = await ConvertAsync(gif);
await ConvertAsync(converted); // throws error
}
}
Error: Exception: Imageflow.Bindings.ImageflowException Error:
ImageMalformed: "unexpected EOF" at imageflow_core/src/codecs/gif/mod.rs:57:91
https://github.com/imazen/imageflow/blob/1f6dc67eef41132d5d3300676daa5d42ae7f8941/imageflow_core/src/codecs/gif/mod.rs#L57
imageflow_core/src/codecs/gif/mod.rs:162:54
https://github.com/imazen/imageflow/blob/1f6dc67eef41132d5d3300676daa5d42ae7f8941/imageflow_core/src/codecs/gif/mod.rs#L162
imageflow_core/src/flow/nodes/codecs_and_pointer.rs:222:65
https://github.com/imazen/imageflow/blob/1f6dc67eef41132d5d3300676daa5d42ae7f8941/imageflow_core/src/flow/nodes/codecs_and_pointer.rs#L222
imageflow_core/src/flow/execution_engine.rs:477:114
https://github.com/imazen/imageflow/blob/1f6dc67eef41132d5d3300676daa5d42ae7f8941/imageflow_core/src/flow/execution_engine.rs#L477
imageflow_core/src/context.rs:419:59
https://github.com/imazen/imageflow/blob/1f6dc67eef41132d5d3300676daa5d42ae7f8941/imageflow_core/src/context.rs#L419
imageflow_core/src/context_methods.rs:50:68
https://github.com/imazen/imageflow/blob/1f6dc67eef41132d5d3300676daa5d42ae7f8941/imageflow_core/src/context_methods.rs#L50
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#643>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA2LH63VDEMIRR4TI24YB3TRYVIFANCNFSM46KEHMAA>
.
|
Hi, here are 2 resize steps, they are the same because this is an example, but the second is executed on the result of the first.
|
Try dropping .ConfigureAwait(false)
…On Fri, Jun 25, 2021, 7:57 AM Pavel Eroshkin ***@***.***> wrote:
Hi, here are 2 resize steps, they are the same because this is an example,
but the second is executed on the result of the first.
public async Task Test(byte[] gif)
{
// first resize
var converted = await ConvertAsync(gif);
// second resize
await ConvertAsync(converted); // throws error
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#643>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA2LHZLTACDBYVP6RZSKYLTUSDLTANCNFSM46KEHMAA>
.
|
doesn't work either |
I think I may be hitting something related to this with imageflow-dotnet-server too. Here's an example GIF I got off Google Images that when stored in Azure Storage (don't think this is relevant) and referenced by imageflow-dotnet-server, fails to render correctly: Stack trace for this error:
|
I think this is a codec problem: image-rs/image-gif#138 |
The "big hug" image is malformed, and the codec I use doesn't support recovering from that (yet).
|
Hello!
Steps to reproduce:
Example gif:
https://media2.giphy.com/media/BLjVY7KIN1fYLLvkLh/giphy.gif?cid=ecf05e472d5ea09f14d415d582fe28c7665c258b75644605&rid=giphy.gif&ct=g
Example code:
Error:
Exception: Imageflow.Bindings.ImageflowException Error: ImageMalformed: "unexpected EOF" at imageflow_core/src/codecs/gif/mod.rs:57:91 https://github.com/imazen/imageflow/blob/1f6dc67eef41132d5d3300676daa5d42ae7f8941/imageflow_core/src/codecs/gif/mod.rs#L57 imageflow_core/src/codecs/gif/mod.rs:162:54 https://github.com/imazen/imageflow/blob/1f6dc67eef41132d5d3300676daa5d42ae7f8941/imageflow_core/src/codecs/gif/mod.rs#L162 imageflow_core/src/flow/nodes/codecs_and_pointer.rs:222:65 https://github.com/imazen/imageflow/blob/1f6dc67eef41132d5d3300676daa5d42ae7f8941/imageflow_core/src/flow/nodes/codecs_and_pointer.rs#L222 imageflow_core/src/flow/execution_engine.rs:477:114 https://github.com/imazen/imageflow/blob/1f6dc67eef41132d5d3300676daa5d42ae7f8941/imageflow_core/src/flow/execution_engine.rs#L477 imageflow_core/src/context.rs:419:59 https://github.com/imazen/imageflow/blob/1f6dc67eef41132d5d3300676daa5d42ae7f8941/imageflow_core/src/context.rs#L419 imageflow_core/src/context_methods.rs:50:68 https://github.com/imazen/imageflow/blob/1f6dc67eef41132d5d3300676daa5d42ae7f8941/imageflow_core/src/context_methods.rs#L50
The text was updated successfully, but these errors were encountered: