Skip to content

Instantly share code, notes, and snippets.

@xight
Created April 1, 2015 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xight/db545f675c448ff14030 to your computer and use it in GitHub Desktop.
Save xight/db545f675c448ff14030 to your computer and use it in GitHub Desktop.
Automator Watermark PDF for OS X Yosemite patch
*** /System/Library/Automator/Watermark PDF Documents.action/Contents/Resources/tool.py 2014-09-10 07:34:59.000000000 +0900
--- tool.py 2014-11-18 15:38:01.000000000 +0900
***************
*** 26,32 ****
def createImage(imagePath):
image = None
! provider = CGDataProviderCreateWithFilename(imagePath)
if provider:
imageSrc = CGImageSourceCreateWithDataProvider(provider, None)
if imageSrc:
--- 26,33 ----
def createImage(imagePath):
image = None
! url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, imagePath, len(imagePath), False)
! provider = CGDataProviderCreateWithURL(url)
if provider:
imageSrc = CGImageSourceCreateWithDataProvider(provider, None)
if imageSrc:
***************
*** 74,79 ****
--- 75,81 ----
yOffset = 0
angle = 0
opacity = 1.0
+ scale = 1.0
# Parse the command line options
try:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment