question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NotImplementedError: lzw_encode

See original GitHub issue

Hi there, I’m trying to write a multi page tiff file, like this

with tifffile.TiffWriter("nyname.tif", append=True) as P: P.write(**this_page_dict)

where the dict is:

{
'extratags': [(274, 3, 1, 1), (339, 3, 1, 1), (285, 2, 25, b'myTitle')], 
'bitspersample': 16,
'compression': 5, 
'photometric': 1, 
'rowsperstrip': 8, 
'planarconfig': 1, 
'resolution': (1677721600, 16777216), 
'data': array(..., dtype=uint16), 
'dtype': dtype('uint16')
}

It’s giving me a NotImplemented error, since I’m using compression=5 (LZW).

Traceback (most recent call last): File “…filename.py”, line 122, in <module> P.write(**this_page_dict) File “…\venv\lib\site-packages\tifffile\tifffile.py”, line 2342, in write strip = compress(strip) File “imagecodecs_imcd.pyx”, line 856, in imagecodecs._imcd.lzw_encode NotImplementedError: lzw_encode

Any pointer as of why and maybe how to “solve” / work around this?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
cookmscottcommented, Dec 27, 2021

Hi @cgohlke , would you suggest using @noobOriented’s work around? If so, I’m not quite sure how to implement that for LZW compression if you could include some notes 🙏

Also for sake of clarity, if imagecodecs is not ready to support LZW encoding, could we update the docs here and here to mention you can only decode with LZW via imagecodecs? Maybe imagecodecs will inlcude LZW soon (seems to be the case) and that’s why this request is still open. Thank you!

2reactions
cgohlkecommented, Jul 27, 2022

Fixed in imagecodecs 2022.7.27.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Throw a NotImplementedError in Python - Stack Overflow
The exception is being thrown because your class CNNnewsSpider does not override the method parse() from scrapy.BaseSpider .
Read more >
[SOLVED]Resolving NotImplementedError? - PyTorch Forums
Hi, I have an issue on creating a super class of autoencoder. The following class causes an error of “NotImplementedError” in module.py when ......
Read more >
Papa John s Pizza_v4.19.11225_apkpure.com.apk
Not all malicious and suspicious indicators are displayed. Get your own cloud service or the full version to view all details. Suspicious ...
Read more >
origami-2.1.0-2-any.pkg.tar.xz Arch Linux Download
/usr/lib/ruby/gems/3.0.0/doc/origami-2.1.0/ri/Origami/Filter/LZW/encode-i.ri ... -2.1.0/ri/Origami/Filter/NotImplementedError/cdesc-NotImplementedError.ri.
Read more >
raise NotImplemented should be raise NotImplementedError ...
Raise NotImplementedError to indicate that a super-class method is not implemented and that child classes should implement it. Anti-pattern. class BaseClass: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found