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

[Windows 10] Permission denied #17

Open
3 tasks done
TobiGr opened this issue Oct 5, 2024 · 0 comments · May be fixed by johndoe31415/llpdf#2
Open
3 tasks done

[Windows 10] Permission denied #17

TobiGr opened this issue Oct 5, 2024 · 0 comments · May be fixed by johndoe31415/llpdf#2

Comments

@TobiGr
Copy link

TobiGr commented Oct 5, 2024

What is the issue?

I get a permission denied error while trying to minify images in a PDF. The error only happens on Windows 10, there are no problems on Linux (Ubuntu 24.04). The command is executed on a different drive. (not c:). Happens on multiple Win10 instances, test VMs and productive machines.

pdfminify version 0.2.2
llpdf version: 0.0.6-rc0

pdfminify --target-dpi 300 pdf.pdf pdf_compressed.pdf
Traceback (most recent call last):
  File "c:\program files (x86)\python38-32\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\program files (x86)\python38-32\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "c:\users\X\appdata\roaming\python\python38\scripts\pdfminify.exe\__main__.py", line 7, in <module>
  File "C:\Users\X\AppData\Roaming\Python\Python38\site-packages\pdfminify\__main__.py", line 148, in main
    pdf_filter.run()
  File "C:\Users\X\AppData\Roaming\Python\Python38\site-packages\llpdf\filters\DownscaleImageOptimization.py", line 94, in run
    resampled_image = self._rescale_image(image, scale_factor)
  File "C:\Users\X\AppData\Roaming\Python\Python38\site-packages\llpdf\filters\DownscaleImageOptimization.py", line 55, in _rescale_image
    resampled_image = reformatter.reformat(image)
  File "C:\Users\X\AppData\Roaming\Python\Python38\site-packages\llpdf\img\ImageReformatter.py", line 112, in reformat
    reformatted_image = self._reformat_channel(image, lossless)
  File "C:\Users\X\AppData\Roaming\Python\Python38\site-packages\llpdf\img\ImageReformatter.py", line 79, in _reformat_channel
    image.writefile(src_img_file.name)
  File "C:\Users\X\AppData\Roaming\Python\Python38\site-packages\llpdf\img\PDFImage.py", line 197, in writefile
    with open(filename, "wb") as f:
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\X\\AppData\\Local\\Temp\\\src_img_k77m5a0q.jpg'

Happens with every file containing an image, e.g. this pdf: pdf.pdf

All Info Provided

  • I have described the exact command line I was using
  • I have included the version number of pdfminify I'm using
  • I have attached an example PDF that exhibits the issue
Repository owner deleted a comment Oct 24, 2024
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

Successfully merging a pull request may close this issue.

1 participant