-
Notifications
You must be signed in to change notification settings - Fork 27
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
uncompressed bitmap length error #8
Comments
Hi, |
Hi, I think you are right, the other notes with the plain template are working. I've created a new note with the custom template, which the converter fails to convert. Here it is: and here is the template: |
Hi,
I added a workaround to treat 2nd MAINLAYER as BGLAYER and now I can convert them. |
I submitted a new commit 566b29c that fix bitmap length problem. This is the error message on trying to convert Trades.note with the tool before applying the patch:
It is similar to your first report, so perhaps the first report was also due to this issue. |
Thanks for your prompt fix.
On 11/22/21 0:00:38, jya ***@***.***> wrote:
Closed #8 [#8].
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub [#8 (comment)], or unsubscribe [https://github.com/notifications/unsubscribe-auth/AGFDXAR2E7OWD3TIV5RLJ5TUNHE7LANCNFSM5HY7X4XQ].
Triage notifications on the go with GitHub Mobile for iOS [https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675] or Android [https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub].
|
Hi, just wanted to let you know that the latest supernote beta 2.04 changed
the .note format, and the library not working anymore with it.
(UnsupportedFileFormat: unsupported file format)
I'm attaching a test .note from the new beta.
My understanding is that Ratta plans to release the new version in a couple
of weeks, maybe even next week.
If you would be able to update the library it would be amazing
|
Thank you for the notice. Thanks. |
Hi, thanks for the library, but it doesn't work for all files. I've tried to convert several notes and some of them are failing with the mistakes like this:
DecoderException Traceback (most recent call last)
d:\Dropbox#PY\supernote-tool-master\supernote-tool.py in
25 for i in range(0, total_pages):
26 converter = sn.converter.ImageConverter(notebook)
---> 27 img = converter.convert(i)
28
29 html += '
'
d:\Dropbox#PY\supernote-tool-master\supernotelib\converter.py in convert(self, page_number, visibility_overlay)
62 page = self.note.get_page(page_number)
63 if page.is_layer_supported():
---> 64 return self._convert_layered_page(page, self.palette, visibility_overlay)
65 else:
66 return self._convert_nonlayered_page(page, self.palette, visibility_overlay)
d:\Dropbox#PY\supernote-tool-master\supernotelib\converter.py in _convert_layered_page(self, page, palette, visibility_overlay)
88 if custom_bg:
89 decoder = Decoder.PngDecoder()
---> 90 img = self._create_image_from_decoder(decoder, binary, palette=palette, blank_hint=all_blank)
91 imgs[layer_name] = img
92 return self._flatten_layers(page, imgs, visibility_overlay)
d:\Dropbox#PY\supernote-tool-master\supernotelib\converter.py in _create_image_from_decoder(self, decoder, binary, palette, blank_hint)
116
117 def _create_image_from_decoder(self, decoder, binary, palette=None, blank_hint=False):
--> 118 bitmap, size, bpp = decoder.decode(binary, palette=palette, all_blank=blank_hint)
119 if bpp == 32:
120 img = Image.frombytes('RGBA', size, bitmap)
d:\Dropbox#PY\supernote-tool-master\supernotelib\decoder.py in decode(self, data, palette, all_blank)
184 expected_length = fileformat.PAGE_HEIGHT * fileformat.PAGE_WIDTH * int(bit_per_pixel / 8)
185 if len(uncompressed) != expected_length:
--> 186 raise exceptions.DecoderException(f'uncompressed bitmap length = {len(uncompressed)}, expected = {expected_length}')
187
188 return bytes(uncompressed), (fileformat.PAGE_WIDTH, fileformat.PAGE_HEIGHT), bit_per_pixel
DecoderException: uncompressed bitmap length = 2618568, expected = 2628288
The text was updated successfully, but these errors were encountered: