SHARE
TWEET

Untitled

a guest Jun 18th, 2019 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bash = "width=`identify -ping -format '%w' {}` ".format('design_adjusted.png')
  2.             bash += "height=`identify -ping -format '%h' {}` ".format('design_adjusted.png')
  3.             bash += "wx=$(($width-1)) hy=$(($height-1)) "
  4.             bash += "coords='0,0 657,926  ${},0 1254,1067  ${},${} 1133,2051  0,${} 419,1803' ".format('wx','wx','hy','hy')
  5.             bash += "width=`identify -ping -format '%w' {}` ".format('template_white.png')
  6.             bash += "height=`identify -ping -format '%h' {}` ".format('template_white.png')
  7.             bash += "dims='${}x${}'  ".format('width','height')
  8.             bash += 'convert \ -size $dims xc:none \  \( {} -alpha set -virtual-pixel transparent '.format('design_adjusted.png')
  9.             bash += '+distort Perspective "$coords" \) \-geometry +419+926 -compose Over -composite design_positioned.png'
  10.             os.system(bash)
  11.             if os.path.isfile("/home/rexweb/Desktop/project/design_positioned.png"):
  12.                     return "<h1>SUCCESS</h1>"
  13.             return '<h1>ERROR</h1>'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top