fsiler / pdfsizeopt

Automatically exported from code.google.com/p/pdfsizeopt
0 stars 0 forks source link

Doesn't work as a symlink #54

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
///////
--- pdfsizeopt.py       2012/01/19 11:13:50     1.3
+++ pdfsizeopt.py       2012/01/19 12:05:37
@@ -6855,7 +6855,10 @@
      os.path.basename(__file__), rev or 'UNKNOWN', size)

  # Find image converters in script dir first.
-  script_dir = os.path.dirname(os.path.abspath(__file__))
+  if os.path.islink(__file__):
+    script_dir = os.path.dirname(os.path.abspath(os.readlink(__file__)))
+  else:
+    script_dir = os.path.dirname(os.path.abspath(__file__))
  os.environ['PATH'] = '%s%s%s' % (
      script_dir, os.pathsep, os.getenv('PATH', ''))
  if (not os.getenv('PDFSIZEOPT_GS', '') and
///////

This allows to run pdfsizeopt.py through a symbolic link.

Original issue reported on code.google.com by pts...@gmail.com on 19 Jan 2012 at 12:48

GoogleCodeExporter commented 9 years ago
Reported and patch sent by Oleg.

Original comment by pts...@gmail.com on 19 Jan 2012 at 12:48

GoogleCodeExporter commented 9 years ago
Fixed in r172, using a more general patch which works on Windows as well.

Original comment by pts...@gmail.com on 19 Jan 2012 at 12:50