Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6930549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:27:42+00:00 2026-05-27T11:27:42+00:00

I want to create and modify image of website, and image can be created

  • 0

I want to create and modify image of website, and image can be created in right location now as below code, but I can’t modify and format those images.

class Bookmark(models.Model):

    title = models.CharField(max_length=200)
    user = models.ForeignKey(User)       
    link = models.ForeignKey(Link)

    def __unicode__(self):
        return "%s, %s" % (self.user, self.link.url)
    def save_image(self):
        import subprocess
        import os
        url = self.link.url.replace("http://","").replace("https://","")\
                  .replace("/","|")
        image_png = './teststatic/url_image/' + url + ".png"
        image_jpg = './teststatic/url_image/' + url + ".jpg"
        command_line = "python", "webkit2png.py","-o", image_png, self.link.url
        image_crop = "mogrify", "-crop", "1280x1024+0+0", image_png
        image_convert = "mogrify", "-format", "jpg", image_png 
        image_del = "rm", image_png
        image_resize = "mogrify", "-resize", "150", "-quality", "80", image_jpg
        p1=subprocess.Popen(command_line, stdout=subprocess.PIPE)
        p2=subprocess.Popen(image_crop, stdin=p1.stdout, stdout=subprocess.PIPE)
        p3=subprocess.Popen(image_convert, stdin=p2.stdout, stdout=subprocess.PIPE)
        p4=subprocess.Popen(image_del, stdin=p3.stdout, stdout=subprocess.PIPE)
        subprocess.Popen(image_resize, stdin=p4.stdout, stdout=subprocess.PIPE)

Here the error trace (reformated for readability) :

mogrify: unable to open image `./teststatic/url_image/z.cn.png': \
   png.la @ error/blob.c/OpenBlob/2489mogrify: unable to open image \
   `./teststatic/url_image/z.cn.png': png.la @ error/blob.c/OpenBlob/2489rm: \
    cannot remove `./teststatic/url_image/z.cn.png': No such file or directory
.
mogrify: unable to open image `./teststatic/url_image/z.cn.png':  \
    @ error/blob.c/OpenBlob/2489.
mogrify: unable to open file `./teststatic/url_image/z.cn.png' \
    @ error/png.c/ReadPNGImage/2951.
.
mogrify: unable to open image `./teststatic/url_image/z.cn.png': \
    @ error/blob.c/OpenBlob/2489.
mogrify: unable to open file `./teststatic/url_image/z.cn.png' \
    @ error/png.c/ReadPNGImage/2951.
mogrify: unable to open image `./teststatic/url_image/z.cn.jpg': \
    jpeg.la @ error/blob.c/OpenBlob/2489.
mogrify: unable to open image `./teststatic/url_image/z.cn.jpg': \
     @ error/blob.c/OpenBlob/2489.
rm: cannot remove `./teststatic/url_image/www.igoogle.com|.png': \
    No such file or directory
mogrify: unable to open image `./teststatic/url_image/www.igoogle.com|.png': \
    png.la @ error/blob.c/OpenBlob/2489.
mogrify: unable to open image `./teststatic/url_image/www.igoogle.com|.png': \
     @ error/blob.c/OpenBlob/2489.
mogrify: unable to open file `./teststatic/url_image/www.igoogle.com|.png'\
     @ error/png.c/ReadPNGImage/2951.
mogrify: unable to open image `./teststatic/url_image/www.igoogle.com|.png':\
     png.la @ error/blob.c/OpenBlob/2489mogrify: unable to open image \
    `./teststatic/url_image/www.igoogle.com|.jpg': \
    jpeg.la @ error/blob.c/OpenBlob/2489.
mogrify: unable to open image `./teststatic/url_image/www.igoogle.com|.png': \
     @ error/blob.c/OpenBlob/2489.
mogrify: unable to open file `./teststatic/url_image/www.igoogle.com|.png' \
    @ error/png.c/ReadPNGImage/2951.
rm: .
mogrify: unable to open image `./teststatic/url_image/www.igoogle.com|.jpg':  \
    @ error/blob.c/OpenBlob/2489.
cannot remove `./teststatic/url_image/www.z.cn|.png': No such file or directory
mogrify: unable to open image `./teststatic/url_image/www.z.cn|.png':\
     png.la @ error/blob.c/OpenBlob/2489.
mogrify: unable to open image `./teststatic/url_image/www.z.cn|.png': \
     @ error/blob.c/OpenBlob/2489.
mogrify: unable to open file `./teststatic/url_image/www.z.cn|.png'\
     @ error/png.c/ReadPNGImage/2951.
mogrify: unable to open image `./teststatic/url_image/www.z.cn|.png': \
    png.la @ error/blob.c/OpenBlob/2489.
mogrify: unable to open image `./teststatic/url_image/www.z.cn|.png':  \
    @ error/blob.c/OpenBlob/2489.
mogrify: unable to open file `./teststatic/url_image/www.z.cn|.png'\
     @ error/png.c/ReadPNGImage/2951.
rm: mogrify: unable to open image `./teststatic/url_image/www.z.cn|.jpg': \
    jpeg.la @ error/blob.c/OpenBlob/2489cannot remove `./teststatic/url_image
...
...

The pipe has some problems, how do I solve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:27:43+00:00Added an answer on May 27, 2026 at 11:27 am

    Your second process depends on the file which is generated by the first process. However the first process is not yet finished when the second is started, so png image does not yet exists. Use subprocess.call() instead, or the wait() method:

    p1=subprocess.Popen(command_line, stdout=subprocess.PIPE)
    return_code = p1.wait()
    if return_code > 0:
        raise Exception('First process failed!')
    
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want create image animation , i have 50 images with png format now
I have a bunch of annotated, interrelated POJOs that I want to create/modify/search over
I want create wordpress website into which I want create user management... That means
I want create an application with animate button? how can i do? after click
i want create Dynamic Slideshow in Jquery i'm Write this code var ctx =
I want to know I can dynamically modify an existing Crystal Report (using C#
I have array with colors as its objects. I want to create an image
I was wondering if there is any way to create/modify an orchestration by code
Now i use TabActivity to display my two lists but now i want to
For example: if I want to create buttons, which, when pressed, each modify a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.