How do I solve an image validation error?

40 views
Skip to first unread message

Maurice Waka

unread,
Oct 6, 2019, 3:18:31 AM10/6/19
to web2py-users
I was looking for a good image app and came across this link.
After uploading it, on trying to upload an image, I get this error:
Traceback (most recent call last):
 
File "/home/mauricewaka/web2py/gluon/restricted.py", line 219, in restricted
 
exec(ccode, environment)
 
File "/home/mauricewaka/web2py/applications/w2p_gallery/controllers/default.py", line 176, in <module>
 
File "/home/mauricewaka/web2py/gluon/globals.py", line 421, in <lambda>
 
self._caller = lambda f: f()
 
File "/home/mauricewaka/web2py/gluon/tools.py", line 3869, in f
 
return action(*a, **b)
 
File "/home/mauricewaka/web2py/applications/w2p_gallery/controllers/default.py", line 124, in edit_image
 
if form.accepts(request.vars, session):
 
File "/home/mauricewaka/web2py/gluon/sqlhtml.py", line 1785, in accepts
 
**kwargs
 
File "/home/mauricewaka/web2py/gluon/html.py", line 2149, in accepts
 status
= self._traverse(status, hideerror)
 
File "/home/mauricewaka/web2py/gluon/html.py", line 910, in _traverse
 newstatus
= c._traverse(status, hideerror) and newstatus
 
File "/home/mauricewaka/web2py/gluon/html.py", line 910, in _traverse
 newstatus
= c._traverse(status, hideerror) and newstatus
 
File "/home/mauricewaka/web2py/gluon/html.py", line 910, in _traverse
 newstatus
= c._traverse(status, hideerror) and newstatus
 
[Previous line repeated 1 more time]
 
File "/home/mauricewaka/web2py/gluon/html.py", line 917, in _traverse
 newstatus
= self._validate()
 
File "/home/mauricewaka/web2py/gluon/html.py", line 1895, in _validate
 
raise Exception(msg)
Exception: Validation error, field:file <applications.w2p_gallery.modules.images.RESIZE object at 0x7f85ff5cf7b8>

How do I solve this error.
Kind regards

Maurice Waka

unread,
Oct 6, 2019, 7:29:10 AM10/6/19
to web2py-users
Found out it's was a python 3.7 vs 2.7 when dealing with syringIO.
I managed to change code at module images.py to
try:
    from StringIO import StringIO 
except ImportError:
    from io import StringIO 

This was instead of 
import cStringIO

Now a new form error, error comes still when uploading : 
image.resize
What could be wrong with this. 


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/PqXEKxIBD1w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/47606eb6-6e46-4935-a198-1fb4773585c4%40googlegroups.com.

villas

unread,
Oct 8, 2019, 11:48:16 AM10/8/19
to web2py-users
Do you have Pillow image library installed?

Check with python commandline:
>> from PIL import Image

If the system comes back with a ">>>", the Pillow modules are properly installed.

If not, install it...
pip install Pillow
To unsubscribe from this group and all its topics, send an email to web...@googlegroups.com.

Maurice Waka

unread,
Oct 13, 2019, 5:49:42 AM10/13/19
to web2py-users
Hello
I did the install but still get the same error.
regards

To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/1a313006-577a-4032-9f4b-d8c021f6b52a%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages