Re: PIL & imagefield validation

2009-08-19 Thread zayatzz

OK. Apparently this is not PIL problem.

I replaced validation errormessage with custom messages for debugging
and i found out that imagefield validation fails here :

try:
# load() is the only method that can spot a truncated
JPEG,
#  but it cannot be called sanely after verify()
trial_image = Image.open(file)
-->   trial_image.load()

If i comment that .load() line out i got IOerror:
IOError at /profile/edit/

decoder jpeg not available

So apparently, even though i reinstalled jpeg before installing PIL,
there is something wrong with jpeg module pathing and i have to remove
and reinstall that too.

Alan.

On Aug 19, 10:09 pm, zayatzz  wrote:
> I followed the instructions on that website.
>
> I used kfind to find all files/folders containing PIL. I removed
> PIL.pth files and PIL folders from several places. Then i tried
> importing PIL in python prompt and got the error. - no pil in the
> system.
>
> Then i reinstalled PIL. tested it and got the validation error message
> again. Then i deleted django, i deleted it under python2.6 site-
> packages, and dist packages, i deleted the unpacked folder also.
> decompressed the tar file, built and reinstalled it again. Still no
> changes.  So i  guess only thing to try is either troubleshoot the
> fields.py and find out why it gives the error and if it can or cannot
> import the pil, or reinstall ubuntu and start from clean system.
>
> Or do you have any other ideas?
>
> Alan.
>
> On Aug 19, 5:41 am, Malcolm MacKinnon  wrote:
>
> > For what it's worth, here's what helped me about a month ago. The PIL
> > installation process is a mess, and I had to follow these instructions, step
> > by step.
> > I think I've fixed the problem. It had to so with  PIL not being installed
> > correctly. Check out this 
> > link:http://www.answermysearches.com/fixing-pil-ioerror-decoder-jpeg-not-a...
> > for
> > a possible solution. Now, jpeg images are uploaded and saved.
>
> > On Mon, Aug 17, 2009 at 11:24 AM, zayatzz  wrote:
>
> > > Hello
>
> > > On sunday i had problems with python when i installed stackless
> > > python. Now i have compiled and installed :
> > > setuptools & python-mysqldb and i got my django project up and running
> > > again. (i also reinstalled django-1.1),
> > > Then i compiled and installed, jpeg, freetyp2 and PIL. I also started
> > > using mod_wsgi instead of mod_python.
>
> > > But when uploading imagefield in form i  get validationerror:
> > > Upload a valid image. The file you uploaded was either not an image or
> > > a corrupted image.
>
> > > Searchmonkey shows that it comes from field.py imagefield validation.
> > > before raising this error it imports Image from PIL, opens file and
> > > verfies it. I tried importing PIL from python prompt manually - it
> > > worked just fine. Same with Image.open and Image.verify.
>
> > > So what could by causing this problem?
>
> > > Alan
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: PIL & imagefield validation

2009-08-19 Thread zayatzz

I followed the instructions on that website.

I used kfind to find all files/folders containing PIL. I removed
PIL.pth files and PIL folders from several places. Then i tried
importing PIL in python prompt and got the error. - no pil in the
system.

Then i reinstalled PIL. tested it and got the validation error message
again. Then i deleted django, i deleted it under python2.6 site-
packages, and dist packages, i deleted the unpacked folder also.
decompressed the tar file, built and reinstalled it again. Still no
changes.  So i  guess only thing to try is either troubleshoot the
fields.py and find out why it gives the error and if it can or cannot
import the pil, or reinstall ubuntu and start from clean system.

Or do you have any other ideas?

Alan.

On Aug 19, 5:41 am, Malcolm MacKinnon  wrote:
> For what it's worth, here's what helped me about a month ago. The PIL
> installation process is a mess, and I had to follow these instructions, step
> by step.
> I think I've fixed the problem. It had to so with  PIL not being installed
> correctly. Check out this 
> link:http://www.answermysearches.com/fixing-pil-ioerror-decoder-jpeg-not-a...
> for
> a possible solution. Now, jpeg images are uploaded and saved.
>
> On Mon, Aug 17, 2009 at 11:24 AM, zayatzz  wrote:
>
> > Hello
>
> > On sunday i had problems with python when i installed stackless
> > python. Now i have compiled and installed :
> > setuptools & python-mysqldb and i got my django project up and running
> > again. (i also reinstalled django-1.1),
> > Then i compiled and installed, jpeg, freetyp2 and PIL. I also started
> > using mod_wsgi instead of mod_python.
>
> > But when uploading imagefield in form i  get validationerror:
> > Upload a valid image. The file you uploaded was either not an image or
> > a corrupted image.
>
> > Searchmonkey shows that it comes from field.py imagefield validation.
> > before raising this error it imports Image from PIL, opens file and
> > verfies it. I tried importing PIL from python prompt manually - it
> > worked just fine. Same with Image.open and Image.verify.
>
> > So what could by causing this problem?
>
> > Alan
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: PIL & imagefield validation

2009-08-18 Thread Malcolm MacKinnon
For what it's worth, here's what helped me about a month ago. The PIL
installation process is a mess, and I had to follow these instructions, step
by step.
I think I've fixed the problem. It had to so with  PIL not being installed
correctly. Check out this link:
http://www.answermysearches.com/fixing-pil-ioerror-decoder-jpeg-not-available/320/
for
a possible solution. Now, jpeg images are uploaded and saved.

On Mon, Aug 17, 2009 at 11:24 AM, zayatzz  wrote:

>
> Hello
>
> On sunday i had problems with python when i installed stackless
> python. Now i have compiled and installed :
> setuptools & python-mysqldb and i got my django project up and running
> again. (i also reinstalled django-1.1),
> Then i compiled and installed, jpeg, freetyp2 and PIL. I also started
> using mod_wsgi instead of mod_python.
>
> But when uploading imagefield in form i  get validationerror:
> Upload a valid image. The file you uploaded was either not an image or
> a corrupted image.
>
> Searchmonkey shows that it comes from field.py imagefield validation.
> before raising this error it imports Image from PIL, opens file and
> verfies it. I tried importing PIL from python prompt manually - it
> worked just fine. Same with Image.open and Image.verify.
>
> So what could by causing this problem?
>
> Alan
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: PIL & imagefield validation

2009-08-18 Thread Michael
On Tue, Aug 18, 2009 at 4:44 PM, zayatzz  wrote:

>
> Buh... well instructions for installing & compiling ship with the
> software. Can you tell me how to uninstall those modules?
>

Not a clue. You can start in site-packages or go into the shell and
type import PIL PIL.__file__ to see where that file might be. You'll
also want to check anywhere in your sys path. I cannot take
responsibility if you break anything though.

I am grasping FYI. I really have no idea what is going on, nor have you
given too much information.

Sorry I can't be more helpful,

Michael

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: PIL & imagefield validation

2009-08-18 Thread zayatzz

Buh... well instructions for installing & compiling ship with the
software. Can you tell me how to uninstall those modules?

Alan.

On Aug 18, 11:40 pm, Michael  wrote:
> On Tue, Aug 18, 2009 at 4:37 PM, zayatzz  wrote:
>
> > Nobody knows? Any wild guesses? Cause im all out of ideas.
>
> > Alan.
>
> > On Aug 17, 9:24 pm, zayatzz  wrote:
> > > Hello
>
> > > On sunday i had problems with python when i installed stackless
> > > python. Now i have compiled and installed :
> > > setuptools & python-mysqldb and i got my django project up and running
> > > again. (i also reinstalled django-1.1),
> > > Then i compiled and installed, jpeg, freetyp2 and PIL. I also started
> > > using mod_wsgi instead of mod_python.
>
> > > But when uploading imagefield in form i  get validationerror:
> > > Upload a valid image. The file you uploaded was either not an image or
> > > a corrupted image.
>
> > > Searchmonkey shows that it comes from field.py imagefield validation.
> > > before raising this error it imports Image from PIL, opens file and
> > > verfies it. I tried importing PIL from python prompt manually - it
> > > worked just fine. Same with Image.open and Image.verify.
>
> > > So what could by causing this problem?
>
> > > Alan
>
> Unistall PIL. Make sure you can't import PIL or Image, Reinstall PIL. I had
> a similar issue recently and that fixed it. Also all the supporting
> libraries. PIL has some really strange pathing and Django relies on just
> one, so if you messed it up, things won't work.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: PIL & imagefield validation

2009-08-18 Thread Michael
On Tue, Aug 18, 2009 at 4:37 PM, zayatzz  wrote:

>
> Nobody knows? Any wild guesses? Cause im all out of ideas.
>
> Alan.
>
> On Aug 17, 9:24 pm, zayatzz  wrote:
> > Hello
> >
> > On sunday i had problems with python when i installed stackless
> > python. Now i have compiled and installed :
> > setuptools & python-mysqldb and i got my django project up and running
> > again. (i also reinstalled django-1.1),
> > Then i compiled and installed, jpeg, freetyp2 and PIL. I also started
> > using mod_wsgi instead of mod_python.
> >
> > But when uploading imagefield in form i  get validationerror:
> > Upload a valid image. The file you uploaded was either not an image or
> > a corrupted image.
> >
> > Searchmonkey shows that it comes from field.py imagefield validation.
> > before raising this error it imports Image from PIL, opens file and
> > verfies it. I tried importing PIL from python prompt manually - it
> > worked just fine. Same with Image.open and Image.verify.
> >
> > So what could by causing this problem?
> >
> > Alan


Unistall PIL. Make sure you can't import PIL or Image, Reinstall PIL. I had
a similar issue recently and that fixed it. Also all the supporting
libraries. PIL has some really strange pathing and Django relies on just
one, so if you messed it up, things won't work.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: PIL & imagefield validation

2009-08-18 Thread zayatzz

Nobody knows? Any wild guesses? Cause im all out of ideas.

Alan.

On Aug 17, 9:24 pm, zayatzz  wrote:
> Hello
>
> On sunday i had problems with python when i installed stackless
> python. Now i have compiled and installed :
> setuptools & python-mysqldb and i got my django project up and running
> again. (i also reinstalled django-1.1),
> Then i compiled and installed, jpeg, freetyp2 and PIL. I also started
> using mod_wsgi instead of mod_python.
>
> But when uploading imagefield in form i  get validationerror:
> Upload a valid image. The file you uploaded was either not an image or
> a corrupted image.
>
> Searchmonkey shows that it comes from field.py imagefield validation.
> before raising this error it imports Image from PIL, opens file and
> verfies it. I tried importing PIL from python prompt manually - it
> worked just fine. Same with Image.open and Image.verify.
>
> So what could by causing this problem?
>
> Alan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



PIL & imagefield validation

2009-08-17 Thread zayatzz

Hello

On sunday i had problems with python when i installed stackless
python. Now i have compiled and installed :
setuptools & python-mysqldb and i got my django project up and running
again. (i also reinstalled django-1.1),
Then i compiled and installed, jpeg, freetyp2 and PIL. I also started
using mod_wsgi instead of mod_python.

But when uploading imagefield in form i  get validationerror:
Upload a valid image. The file you uploaded was either not an image or
a corrupted image.

Searchmonkey shows that it comes from field.py imagefield validation.
before raising this error it imports Image from PIL, opens file and
verfies it. I tried importing PIL from python prompt manually - it
worked just fine. Same with Image.open and Image.verify.

So what could by causing this problem?

Alan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---