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

Files chosen from "Recent" are not compressed. #9

Closed
abhi-deshpande opened this issue Jan 19, 2022 · 3 comments
Closed

Files chosen from "Recent" are not compressed. #9

abhi-deshpande opened this issue Jan 19, 2022 · 3 comments

Comments

@abhi-deshpande
Copy link

abhi-deshpande commented Jan 19, 2022

When a file is selected from the "Recent" place of the gtkfilechooser, it seems to be ignored. Only a notification is sent that pdf is compressed, but the progress bar just moves infinitely. No any output file is generated.

But, if the same file is chosen from its absolute path without using recents, it is compressed correctly.

This behaviour was seen on Densify AppImage 0.3.1 running on MX Linux 21.

@SonephetR2
Copy link

I had a hard time understanding why Densify sometimes works fine and sometimes wouldn't and this is it. I can confirm this behaviour on Densify AppImage 0.3.1 running on Linux Mint 20.3. Further, the same happens when using drag-and-drop. The app seems to be consistently working only when fetching the file via the "Select a File" button.

@jose1711
Copy link

jose1711 commented Mar 5, 2023

Adding a console output:

GPL Ghostscript 10.00.0: **** Could not open the file None/a.pdf .
**** Unable to open the initial device, quitting.
Traceback (most recent call last):
  File "/usr/share/densify/densify", line 309, in on_button_clicked
    oFileSizeRaw = os.path.getsize(oFile)
  File "/usr/lib/python3.10/genericpath.py", line 50, in getsize
    return os.stat(filename).st_size
FileNotFoundError: [Errno 2] No such file or directory: 'None/foo_output.pdf'

What seems to be happening here is that unless you select the file manually the iChooser object (Gtk.FileChooserButton()) does not populate the current folder variable, hence this:

iPath = str(self.iChooser.get_current_folder())

produces None. What appears to be working much better is simply use the same output as the input file (regardless the method used to select it), i. e. change the line to:

iPath = os.path.dirname(iFile)

If someone wants to test properly I can raise a PR.

@hkdb
Copy link
Owner

hkdb commented Jun 24, 2024

@jose1711 Thanks for all your involvement while I have been super buried with work and other projects. This issue should be resolved in v0.13.2 thanks to @batikstudio. As such I will be closing it.

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

4 participants