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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:58:54+00:00 2026-05-16T02:58:54+00:00

I’ve been struggling with this error for several days with little headway. Basically, I’m

  • 0

I’ve been struggling with this error for several days with little headway. Basically, I’m trying to read in an image file and then use PIL to preform a specific operation on it. (my end goal is to preform a PIL paste operation).

However, whenever I load my image in, and then invoke the load() method on it (operations like show(), paste(), resize(), etc. all invoke the load() method), I get a weird NoneType has no attribute read error.

I’m using PIL 1.1.7 and have reproduced this error on both OSX 10.6 and Ubuntu 10.04. Below is the most basic ipython code that I can enter to produce the error.

Has anyone see this type of situation before?

Any help is much appreciated.

In [1]: import os
In [2]: try:
   ...:     from PIL import Image
   ...: except ImportError:
   ...:     import Image
   ...: 
In [3]: from django.conf import settings
In [4]: bgImageFileHash = "d41d8cd98f00b204e9800998ecf8427e"
In [5]: bgImageFilePath = os.path.join(settings.MEDIA_ROOT,'uploads',"%s.jpg" % (bgImageFileHash)) 
In [6]: print bgImageFilePath 
------> print(bgImageFilePath )
/Users/test/Sites/env/mysite/proj/mysite/../mysite/media/uploads/d41d8cd98f00b204e9800998ecf8427e.jpg
In [7]: bgImageImage=Image.open(bgImageFilePath)
In [8]: bgImageImage.verify()
In [9]: bgImageImage.load()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/Users/test/Sites/env/mysite/proj/mysite/<ipython console> in <module>()
/Users/test/Sites/env/mysite/lib/python2.6/site-packages/PIL/ImageFile.pyc in load(self)
    168             read = self.load_read
    169         except AttributeError:
--> 170             read = self.fp.read
    171 
    172         try:
AttributeError: 'NoneType' object has no attribute 'read'
  • 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-16T02:58:55+00:00Added an answer on May 16, 2026 at 2:58 am

    Maybe remove the call to verify(), or put a second call to open() between verify() and load()?

    The documention on verify() here says:

    …if you need to load the image after using this method, you must reopen the image file.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a jquery bug and I've been looking for hours now, I can't
I'm looking for suggestions for debugging... If you view this site in Firefox or
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have just tried to save a simple *.rtf file with some websites and
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I am trying to loop through a bunch of documents I have to put

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.