Comments (9)
I have made the fix already here. If you like, I can make one for you, too, and perhaps add a test to prove it.
from imagecodecs.
Thanks for the report. I can apply the patch but a test or image would be useful.
from imagecodecs.
There is a more actively maintained version of lj92 at https://github.com/ilia3101/MLV-App/blob/master/src/mlv/liblj92/lj92.c. It seems to include a fix for this issue. Can you confirm? I'll probably switch to that source.
For reference, there's yet another version at https://github.com/syoyo/tinydng/blob/master/tiny_dng_loader.h#L480
from imagecodecs.
Why do you say that it seems to include a fix? Where is that fix?
from imagecodecs.
I see it now: ilia3101/MLV-App@170ec64
Yup., that's the issue. I don't know if the fix is correct but it might be.
from imagecodecs.
How do you run tests on this repo? If you have unit testing, I can provide a file that you can use for your testing.
I tried this but it didn't work:
python3 setup.py test
from imagecodecs.
How do you run tests on this repo?
Run python -m pytest tests
after an inline build or run test_imagecodecs.py
directly. Anyway, building imagecodecs is not straightforward.
I can provide a file that you can use for your testing.
Yes, please.
After applying ilia3101/MLV-App#221 and some other changes, I am now able to read most LJPEG files I could find (not that many).
from imagecodecs.
From the URL https://www.kaggle.com/competitions/rsna-breast-cancer-detection/data you can download a large dataset which includes the file 9989/439796429.dcm
which has inside of it an LJ92 file which I have saved as
. (Trying to download and decode the dataset yourself will be a pain.)
I can confirm that, in my code, this file does not work with the old lj92 but it does work after applying something similar to ilia3101/MLV-App#221 (we did it a different way but it's the same idea).
Can you confirm that your code, on the above file, is not working without the change and then working after it?
Before the change, the first few pixels were incorrectly:
23405
23411
23411
23411
23411
23411
23411
23411
23411
After the change, the first few pixels are:
0
0
0
0
0
0
0
0
Also, from where you do have other lj92 files? We'd like to try them out, too!
from imagecodecs.
Thank you for the test image. I have made several changes to the vendored lj92.c
file in imagecodecs and can confirm that it can now correctly decode your test image.
Also, from where you do have other lj92 files? We'd like to try them out, too!
I usually extract them from DNG and DCM files "found on the internet".
I am attaching the current test images and lj92.c code: ljpeg.zip
from imagecodecs.
Related Issues (20)
- NumPy 2.0 support HOT 6
- IMCD_LZW_TABLE_TOO_SMALL exception with large image HOT 6
- Cannot disable bcn extension HOT 4
- codec not available: 'imagecodecs_jpegxl' HOT 2
- aarch64 install HOT 2
- Not get compression ratio of 10:1 HOT 1
- Decode PackBits with padded bytes. HOT 5
- JPEGLS not available under devbox/nix HOT 3
- No multi-component transform for JPEG2000 lossless HOT 3
- Cannot install imagecodecs HOT 3
- Fails to build with libjxl v0.9: use of undeclared identifier 'JXL_DEC_EXTENSIONS' HOT 2
- Cannot set JPEGXL effort lower than 3 in `jpegxl_encode`? HOT 2
- Checking for distributions (Arch in this case) should be done in a more reliable way HOT 2
- Support for RGB + extra channels for JXL encoding HOT 1
- Is there a compiled version of this? HOT 1
- Feature Request: Add JPEG XL Float Support HOT 2
- Not able to install this module HOT 1
- Cannot disable bcn HOT 3
- Error when slicing in zarr array HOT 4
- Feature Request: add Jpegli codec HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imagecodecs.