0
    '''PYTHON3
            bash = "width=`identify -ping -format '%w' {}` ".format('design_adjusted.png')
            bash += "height=`identify -ping -format '%h' {}` ".format('design_adjusted.png')
            bash += "wx=$(($width-1)) hy=$(($height-1)) "
            bash += "coords='0,0 657,926  ${},0 1254,1067  ${},${} 1133,2051  0,${} 419,1803' ".format('wx','wx','hy','hy')
            bash += "width=`identify -ping -format '%w' {}` ".format('template_white.png') 
            bash += "height=`identify -ping -format '%h' {}` ".format('template_white.png')
            bash += "dims='${}x${}'  ".format('width','height')
            bash += 'convert \\ -size $dims xc:none \\  \\( {} -alpha set -virtual-pixel transparent '.format('design_adjusted.png')
            bash += '+distort Perspective "$coords" \\) \\-geometry +419+926 -compose Over -composite design_positioned.png'
            os.system(bash)
            if os.path.isfile("/home/rexweb/Desktop/project/design_positioned.png"):
                    return "<h1>SUCCESS</h1>"
            return '<h1>ERROR</h1>'

'''

4
  • And what is your question exactly? How does it relate to Ubuntu? Jun 18, 2019 at 12:03
  • i am using imagemagick for converting and posiioning of image over one another. when i run the above code it says memory allocation failed in terminal while running os commands. Jun 18, 2019 at 12:07
  • So, you use bash to run a python program that runs a bash command? Looks complex to me. anyway, the bash command you run (with line os.system(bash) starts with width ='identify.... It is no bash command at all. As I see no reference to imagemagick in your code, I think you forgot something. Jun 18, 2019 at 12:25
  • these are command of imagemagick running in os.system(bash) . i would upload the file on a CDN and send you link if you could help. Jun 18, 2019 at 12:32

0

You must log in to answer this question.

Browse other questions tagged .