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

FILTER issues #705

Closed
rogerbinns opened this issue Sep 13, 2013 · 4 comments
Closed

FILTER issues #705

rogerbinns opened this issue Sep 13, 2013 · 4 comments

Comments

@rogerbinns
Copy link
Contributor

The conf.py says to use things like "jpegoptim --strip-all -m75 -v %s" whilst the handbook says to use filters.

The conf.py example won't work correctly with spaces in the filenames or directories since there is no quoting of the %s going on. The own created filters do get passed single quoted filenames, although single quotes are perfectly valid filename characters on Linux, Mac and Windows. Double quotes aren't allowed on Windows. (One of my image files uses single quotes it turns out.) The real problem here is trying to use shell=True to subprocess. I strongly recommend that shlex is used to get a list if a string is supplied to runinplace and then replace whole tokens and run without shell=True. That will always work no matter what the filenames.

At one point my source images all ended up deleted but I haven't been able to reproduce that yet.

In any event the FILTERS didn't appear to work either way. There was no difference in the output/galleries total size with it enabled or commented out. Running jpegoptim manually on the output/galleries image files did give a reduction in size of several percent.

@rogerbinns
Copy link
Contributor Author

I'm certain that conf.py FILTERS has no effect. I added a print command in the filters.py code and nothing was printed. I then added 1/0 and nothing happened either. It also calls tempfile.mkdtemp but does not cleanup the resulting directory.

@rogerbinns
Copy link
Contributor Author

Filters aren't mentioned in the galleries code which could explain why I can't get it to run.

@ralsina
Copy link
Member

ralsina commented Sep 13, 2013

Indeed it seems we are not applying filters to the galleries. Easy to fix, created #708 so this issue is just for the quoting problems.

ralsina added a commit that referenced this issue Sep 13, 2013
@ralsina
Copy link
Member

ralsina commented Sep 13, 2013

Since the galleries not running filters is now in #708 I think this issue can be closed.

@ralsina ralsina closed this as completed Sep 13, 2013
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