Coder Social home page Coder Social logo

Comments (13)

kisvegabor avatar kisvegabor commented on May 27, 2024

Maybe the image is slightly corrupted and full featured desktop viewers can handle it.

I suggest opening and saving the image. Hopefully it'll fixes it.

from lv_lib_png.

glory-man avatar glory-man commented on May 27, 2024

Maybe the image is slightly corrupted and full featured desktop viewers can handle it.

I suggest opening and saving the image. Hopefully it'll fixes it.

I thought about it, but unfortunaly not helped. I was able to draw image by disabling adler32 checking.

from lv_lib_png.

glory-man avatar glory-man commented on May 27, 2024

By the way errors 57 & 58 description tells that - (checking CRC can be disabled) / (checking ADLER32 can be disabled). So in lodepng.h may be added code like this

#ifdef LV_PNG_IGNORE_ADLER32
#define LODEPNG_IGNORE_ADLER32 1
#else
#define LODEPNG_IGNORE_ADLER32 0
#endif

#ifdef LV_PNG_IGNORE_CRC
#define LODEPNG_IGNORE_CRC 1
#else
#define LODEPNG_IGNORE_CRC 0
#endif

So in decompress initialization function may be used LODEPNG_IGNORE_CRC/LODEPNG_IGNORE_ADLER32 instead of 0/1. In this case we don't need edit sources to configure library.

from lv_lib_png.

kisvegabor avatar kisvegabor commented on May 27, 2024

I've just downloaded the image form your first post and it worked for me.

lodepng was update a couple of month ago. Do you use the latest version from the master branch?

from lv_lib_png.

glory-man avatar glory-man commented on May 27, 2024

I've just downloaded the image form your first post and it worked for me.

lodepng was update a couple of month ago. Do you use the latest version from the master branch?

I use lvgl_v7 as part of zephyr os. I made zephyr-module lv_lib_png based on commit 7ff6168.
As far as I understand later commits mades for lvgl_v8 which is incompatible with lvgl_v7

from lv_lib_png.

kisvegabor avatar kisvegabor commented on May 27, 2024

What if you overwrite lodepng.c/h with the latest versions? There shouldn't be v8 related stuff there.

It might also worth a try to download the image from your post. Maybe GitHub converted it.

from lv_lib_png.

glory-man avatar glory-man commented on May 27, 2024

What if you overwrite lodepng.c/h with the latest versions? There shouldn't be v8 related stuff there.

It might also worth a try to download the image from your post. Maybe GitHub converted it.

I'll try it. Thanks.

from lv_lib_png.

glory-man avatar glory-man commented on May 27, 2024

What if you overwrite lodepng.c/h with the latest versions? There shouldn't be v8 related stuff there.

It might also worth a try to download the image from your post. Maybe GitHub converted it.

I tried latest version of lodepng.c. This file uses
lv_fs_seek(&f, 0, SEEK_END)
with 3 params (inside lodepng_filesize), while in lvgl_v7 it has only 2 params. So I use
lv_fs_size(&f, &size);
to detect size of file.
But file still not opened without disabling adler32 checking.

from lv_lib_png.

kisvegabor avatar kisvegabor commented on May 27, 2024

And have you downloaded the image from GitHub (from your first comment)?

from lv_lib_png.

glory-man avatar glory-man commented on May 27, 2024

And have you downloaded the image from GitHub (from your first comment)?

Yes. I tried with image downloaded from github.
In debugger
unsigned ADLER32 = lodepng_read32bitInt(&in[insize - 4]);
called in lodepng_zlib_decompressv function gives me 0xC0C64FFD, while
unsigned checksum = adler32(out->data, (unsigned)(out->size));
gives 0xBF592DC8, out->size = 0x230

from lv_lib_png.

kisvegabor avatar kisvegabor commented on May 27, 2024

I have no idea 🙁

I've tested it again and out->size = 0x230 for me too but checksum = 0xc0c64ffd.

from lv_lib_png.

glory-man avatar glory-man commented on May 27, 2024

I have no idea 🙁

I've tested it again and out->size = 0x230 for me too but checksum = 0xc0c64ffd.

I founded a problem. I use custom allocator function, where lodepng_realloc was incorrect. Fixed by using lv_mem_realloc.

from lv_lib_png.

kisvegabor avatar kisvegabor commented on May 27, 2024

Glad to hear that!

from lv_lib_png.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.