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 7080709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:49:43+00:00 2026-05-28T06:49:43+00:00

I am working on a script that downloads various image files from the web

  • 0

I am working on a script that downloads various image files from the web and then does some processing on them using the PIL. The script uses urlretreive to dump the images to temporary files, and right now I’m just trying to open them in a viewer using the PIL image.show() method. Here is the relevant portion of the code:

def main():

link_queue = Queue.Queue()
image_queue = Queue.Queue()

links = get_image_links('test_search')

for link in links:
    link_queue.put(link)

for image in xrange(len(links)):
    #create image downloading threads
    t = ImageDownloadingThread(link_queue, image_queue)
    t.setDaemon(True)
    t.start()

link_queue.join()

image_data = image_queue.get()
image_file, image_url = image_data[0][0], image_data[1][0] 
#get the first image downloaded and take a look
image = Image.open(image_file)
image.show()

Unfortunately, while the temporary file seems to load OK (Image.open doesn’t return any errors) I get nothing in the viewer when image.show() is called:

enter image description here

I have also tried opening local, non-temporary files, in case that was part of the problem and get the same result. The OS is Windows Vista 32 bit SP2. Any ideas on what might be going wrong?

  • 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-28T06:49:43+00:00Added an answer on May 28, 2026 at 6:49 am

    show() tries to execute the default image viewer with a start /wait command on a temporary image file. The /wait parameter is supposed to wait until the viewer exits, so that the file can be deleted. Unfortunately the default viewer under Vista and Windows 7 does not respond properly to /wait and return even before they’ve opened the file; the file gets deleted before it can be displayed.

    The usual fix is to edit ImageShow.py in the PIL package and add an extra command to wait a few seconds before deleting the file. This is a kludge, but it works most of the time. Details at velocityreviews.com and here at StackOverflow.

    The other way to fix it is to associate the .bmp file format with a program that waits properly before returning, for example mspaint.exe.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script that generates images from text using PHP. It's working fine
I am working on a script that downloads a file from Dropbox, supposed to
Im basically working on an image analyser that downloads images from another server. I
I'm working on a script which downloads some data from Twitter profiles. I found
I'm working on a shell script that does certain changes on a txt file
I am working on a Bash shell script that does something like this: #!/bin/bash
I have a tested and working php script that pulls from a db and
I am working on a script that will process user uploads to the server,
I'm working on a script that needs to set up a Xerox Phaser printer
I'm working on a python script that starts several processes and database connections. Every

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.