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

Unknown error with english path #30

Open
semikonductor opened this issue Dec 16, 2023 · 4 comments
Open

Unknown error with english path #30

semikonductor opened this issue Dec 16, 2023 · 4 comments

Comments

@semikonductor
Copy link

I have read #19 but It does not help me .
I am using windows11.

my code is as follows:

    def is_ascii(s):
        return all(ord(c) < 128 for c in s)

     with tempfile.NamedTemporaryFile(delete=True, dir=r'F:') as tmp:
        print(is_ascii(tmp.name))
        print(tmp.name) 
        jpg = jpegio.read(tmp.name)

here is what I get:

True
F:\tmp4rlv64sm
  File "D:\anaconda\envs\xxxxxx\lib\site-packages\jpegio-0.2.4-py3.8-win-amd64.egg\jpegio\io.py", line 8, in read
    obj.read(fpath)
  File "jpegio\\decompressedjpeg.pyx", line 38, in jpegio.decompressedjpeg.DecompressedJpeg.read
  File "jpegio\\decompressedjpeg.pyx", line 46, in jpegio.decompressedjpeg.DecompressedJpeg.read
RuntimeError: Unknown exception

I guess it has something to do with tempfile library?

@detrin
Copy link
Collaborator

detrin commented Jul 11, 2024

Did you look at tmp.name?

@semikonductor
Copy link
Author

Did you look at tmp.name?

I printed tmp.name, and it's a ascii string.
Or there is something wrong with my approach?

    def is_ascii(s):
        return all(ord(c) < 128 for c in s)

     with tempfile.NamedTemporaryFile(delete=True, dir=r'F:') as tmp:
        print(is_ascii(tmp.name))
        print(tmp.name) 
        jpg = jpegio.read(tmp.name)

@semikonductor
Copy link
Author

I have read #19 but It does not help me . I am using windows11.

my code is as follows:

    def is_ascii(s):
        return all(ord(c) < 128 for c in s)

     with tempfile.NamedTemporaryFile(delete=True, dir=r'F:') as tmp:
        print(is_ascii(tmp.name))
        print(tmp.name) 
        jpg = jpegio.read(tmp.name)

here is what I get:

True
F:\tmp4rlv64sm
  File "D:\anaconda\envs\xxxxxx\lib\site-packages\jpegio-0.2.4-py3.8-win-amd64.egg\jpegio\io.py", line 8, in read
    obj.read(fpath)
  File "jpegio\\decompressedjpeg.pyx", line 38, in jpegio.decompressedjpeg.DecompressedJpeg.read
  File "jpegio\\decompressedjpeg.pyx", line 46, in jpegio.decompressedjpeg.DecompressedJpeg.read
RuntimeError: Unknown exception

I guess it has something to do with tempfile library?

I have finished my job( generate dct array from a pic) using jpeg2dct. It does not cause memory on Linux platform.
Jpegio causes memory leak on Linux , when I tried it on Windows 11, it has english path error.

@detrin
Copy link
Collaborator

detrin commented Jul 12, 2024

Glad you managed to find a workaround that worked for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants