Skip to content
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

KeyError: 'transform' #12

Open
RDeRenzi opened this issue Feb 25, 2022 · 1 comment
Open

KeyError: 'transform' #12

RDeRenzi opened this issue Feb 25, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@RDeRenzi
Copy link

Hi @jmpint,

I wonder if you can help me with this. I get the following initial error (with RM1 2.12.1.527) when I run

rm-dl-annotated.sh "/MYDIR/MYSUBDIR/MYFILE

Traceback (most recent call last):
File "/home/user/git/rm-dl-annotated/is-transformed.py", line 40, in
main()
File "/home/user/git/rm-dl-annotated/is-transformed.py", line 27, in main
transform = content_data['transform']
KeyError: 'transform'

and the following final warnings

WARNING: 6f73712f-0bd1-45bb-b4cf-42c2df4a751e_annotations.pdf: reported number of objects (981) is not one plus the highest object number (1692)
WARNING: 6f73712f-0bd1-45bb-b4cf-42c2df4a751e.pdf (object 197 0): object has offset 0
WARNING: 6f73712f-0bd1-45bb-b4cf-42c2df4a751e.pdf (object 219 0): object has offset 0
WARNING: 6f73712f-0bd1-45bb-b4cf-42c2df4a751e.pdf (object 553 0): object has offset 0
WARNING: 6f73712f-0bd1-45bb-b4cf-42c2df4a751e.pdf (object 1670 0): object has offset 0
qpdf: operation succeeded with warnings; resulting file may have some problems>

Finally I cannot find any MYFILE (exported).pdf

Thanks for your time

Roberto

@jmpinit jmpinit added the bug Something isn't working label Feb 28, 2022
@jmpinit
Copy link
Owner

jmpinit commented Feb 28, 2022

Hello,

It may be that reMarkable has changed the format of the data returned from their API. That part of the script is expecting a key called "transform" with information about how the page has been transformed.

To fix I'd suggest checking what is returned by the API and verifying that the "transform" key is still there when the page is transformed (maybe it has been renamed)? If it is still used and hasn't been renamed but it isn't included if there has not been any transform (previously "no transform" was represented by a unit transformation) then the fix would simply be to print "No" and exit if the key is not present.

It has been a few years since I have last tested this project and I don't have a quick way to test a fix now. When I have time I'll implement a fix. But in the meantime I would gladly accept a PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants