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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:51:07+00:00 2026-05-28T00:51:07+00:00

Possible Duplicate: pip install PIL -E TICKETS-1 – No JPEG/PNG support I’m working on

  • 0

Possible Duplicate:
pip install PIL -E TICKETS-1 – No JPEG/PNG support

I’m working on a picture cropper, and I’m having trouble with my form validation. The form is validated when uploading a GIF picture, but any other format I try raises the following exception:

Upload a valid image. The file you uploaded was either not an image or a corrupted image.

Form

<form enctype="multipart/form-data" method="post" action="/pic/">{% csrf_token %}
    {{ form.as_p }}
    <p><input type="submit" value="View uploaded image"></p>
    <input type="hidden" name="stage" value="crop">
</form>

View

if request.method == 'POST':
        form = ProfilePicForm(request.POST, request.FILES)
        if form.is_valid():
            *do stuff*
        else:
            logger.debug('Form errors == [%s]' % form.errors)

I have installed libjpeg-dev(using apt-get) before installing PIL(using easy_install). At first, I thought this might be due to an incorrect installation of either libjpeg-dev or PIL, but would the problem persists for other formats like png? This problem does in fact occur for png images as well. I’m not getting a jpeg decoder problem, so I’m thinking it’s not that, but I’m not sure. Also, I’m using the django development server.


Update

I decided to try a reinstall of PIL. I deleted my PIL install folder
/usr/local/lib/python2.7/dist-packages/PIL
and my PIL.pth file (in the same dist-packages folder). I ran the setup.py script using sudo python setup.py install. I then ran the selftest.py script, and it fails on the first test:

--------------------------------------------------------------------
PIL 1.1.7 TEST SUMMARY 
--------------------------------------------------------------------
Python modules loaded from ./PIL
Binary modules loaded from ./PIL
--------------------------------------------------------------------
--- PIL CORE support ok
*** TKINTER support not installed
*** JPEG support not installed
*** ZLIB (PNG/ZIP) support not installed
*** FREETYPE2 support not installed
--- LITTLECMS support ok
--------------------------------------------------------------------
Running selftest:
*****************************************************************
Failure in example:
try:
 _info(Image.open(os.path.join(ROOT, "Images/lena.jpg")))
except IOError, v:
 print v
from line #24 of selftest.testimage
Expected: ('JPEG', 'RGB', (128, 128))
Got: decoder jpeg not available
1 items had failures:
   1 of  57 in selftest.testimage
***Test Failed*** 1 failures.
*** 1 tests of 57 failed.

I’m not sure how to get PIL to work with the unsupported modules listed above. I can verify that I have zlib1g-dev, libfreetype6-dev, liblcms1-dev and libjpeg62-dev, and the libraries themselves installed on my system because when I try to install them with apt-get, it says I already have the latest version.

  • 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-28T00:51:08+00:00Added an answer on May 28, 2026 at 12:51 am

    Try downloading PIL from source, then edit setup.py adding this line:

    add_directory(library_dirs, "/usr/lib/i386-linux-gnu")
    

    before this line (214):

    add_directory(library_dirs, "/usr/lib")
    

    then

    sudo python setup.py install
    

    It should work now

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

Sidebar

Related Questions

Possible Duplicate: How to rename java.exe/javaw.exe process? Hi, I am working on java desktop
Possible Duplicate: Space bar not working in form fields Has anyone run into an
Possible Duplicate: Progressbar togther with asyncTask I am having a expandableListView in a project
Possible Duplicate: Why not use tables for layout in HTML? Under what conditions should
Possible Duplicate: NAnt or MSBuild, which one to choose and when? What is the
Possible Duplicate: How do I calculate someone's age in C#? Maybe this could be
Possible Duplicate: .NET - What’s the best way to implement a catch all exceptions
Possible Duplicate: What Ruby IDE do you prefer? I've generally been doing stuff on
Possible Duplicate: How does the Google Did you mean? Algorithm work? Suppose you have
Possible Duplicate: How do you send email from a Java app using Gmail? How

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.