DHT has wrong length: 0

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years ago
Hello Every body.
my customers are trying to Upload pictures,sometime they got this error "DHT has wrong length: 0"

they have to Open the picture with paint and save it again to solve the problem.



i am trying to find a way to solve the problem in code.
is there any way to solve this problem in code when Trying to save picture in Database ?
4 years ago
Hello Frida

We have got the same problem when some category with "different" jpeg image was loaded. I don't know where is the error or why some picture returns this error. We import pictures directly to DB from ERP so we don't know which image is bad.

We've found the solution. There is some bug in SixLabors.ImageSharp in default version 1.0.0.beta0004 which is included in NopServices and this error was described and solved by developer into version 1.0.0.beta0005. But you have to make small change in PictureService.cs file in Nop.Services/Media.

row (24) commented or removed: using SixLabors.ImageSharp.Processing.Transforms;
row (358) changed: pngEncoder.PngColorType = ...  to  pngEncoder.ColorType = PngColorType.RgbWithAlpha;

After this change everything works fine. Try it.

Nop Version 4.10

David
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.