Creating an imageField from a charField

2011-09-26 Thread Mehrms
Does anyone know how to instantiate an imageField using just the URL of the image? I am storing my URLs to images in a charField, but I am letting the user interact with the imageField. Everything works fine to render the imageField and I can use the imageField to upload an image. The url

Re: imagefield problem .....

2011-06-13 Thread Ivo Brodien
angoproject.com/en/dev/ref/models/fields/#filefield > 3) All that will be stored in your database is a path to the file (relative > to MEDIA_ROOT). You'll most likely want to use the convenience url function > provided by Django. For example, if your ImageField is called mug_shot, you

Re: imagefield problem .....

2011-06-13 Thread Pankaj Singh
yes even in get_image_url it will be return os.path.join(settings.MEDIA_URL, 'news', self.image.name.split('/')[-1]) -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Re: imagefield problem .....

2011-06-13 Thread Ivo Brodien
On Jun 13, 2011, at 12:52 PM, Pulkit Mehrotra wrote: > problem in using the address stored in imagefield you should describe your problem a little better! But I guess the URL is not working? You shouldn’t use STATIC_URL but MEDIA_URL for the prefix in your template. STATIC_URL is for sta

imagefield problem .....

2011-06-13 Thread Pulkit Mehrotra
problem in using the address stored in imagefield *this is the news.html:* News {% if news_list %} {% for news in news_list %} {{ news.image }} || {{ news.news }} {% endfor %} {% endif %} *this is the views*: from django.shortcuts import

Re: ImageField issue

2011-06-08 Thread Greg Donald
On Wed, Jun 8, 2011 at 2:51 PM, Daniel Roseman wrote: > But that "bunch of image data" is a string - because that's what .read() > returns. > The FileField documentation [1] shows how to save a disk file to a field: >     from django.core.files import File >     f =

Re: ImageField issue

2011-06-08 Thread Daniel Roseman
On Wednesday, 8 June 2011 20:40:35 UTC+1, Greg Donald wrote: > > I have a model EventType that has an ImageField named image. > > When I post my image upload form I can upload an image with no problems. > > > But when I try to save() an image from the file system I get the er

ImageField issue

2011-06-08 Thread Greg Donald
I have a model EventType that has an ImageField named image. When I post my image upload form I can upload an image with no problems. But when I try to save() an image from the file system I get the error: 'str' object has no attribute 'chunks' Here is my code: et = EventType( name=name

Re: imagefield upload_to

2011-05-11 Thread Brian Craft
solved this by moving it to the model clean() method, and using imagefield.file.open() and imagefield.file.read() to get the data for computing the other fields. On Wed, May 11, 2011 at 1:28 PM, Brian Craft <bc...@thecraftstudio.com> wrote: > I have a model with an imagefield, and so

imagefield upload_to

2011-05-11 Thread Brian Craft
I have a model with an imagefield, and some fields that are computed from the image. I'm trying to override the "save" method to fill in the other fields. When I test this in the admin, there are two problems: first, the path (mymodel.image.path) doesn't honor the upload_to setting on

Re: Accessing ImageField temporary file to dynamically change upload_to storage path

2011-04-26 Thread Thomas Weholt
, metadata and django is appreciated. Regards, Thomas On Tue, Apr 26, 2011 at 8:16 AM, Ian Turner <ian.tur...@gmail.com> wrote: > I'm in need of direction to access the temporary file that is stored > in memory or on disk from an ImageField/FileField so that I can read > it before it ge

Accessing ImageField temporary file to dynamically change upload_to storage path

2011-04-26 Thread Ian Turner
I'm in need of direction to access the temporary file that is stored in memory or on disk from an ImageField/FileField so that I can read it before it gets moved to its final location. The topics I've found all deal with only modifying the storage path based on other fields in a model. My

Re: Can give each user a specific folder to upload to using an ImageField?

2011-04-12 Thread urukay
should also write functions to display images or configure your server to display them. Radovan On 12. Apr, 14:35 h., Thomas Weholt <thomas.weh...@gmail.com> wrote: > I see from the docs that ImageField takes an param called upload_to. I > want to put uploaded files into a spe

Can give each user a specific folder to upload to using an ImageField?

2011-04-12 Thread Thomas Weholt
I see from the docs that ImageField takes an param called upload_to. I want to put uploaded files into a specific folder for that specific user uploading the image. And the target folder is NOT in the media root. Any tips on how to achieve that? -- Mvh/Best regards, Thomas Weholt http

ImageField and quality after save

2011-03-25 Thread galgal
How can I set the image quality to 100? The default value in PIL i 75 and Django saves an image with that value. Where can I change it? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: ImageField not deleted while changing

2011-02-27 Thread Artur Wdowiarski
Borislav is right, although it seems to me that overriding the model's save method would be more appropriate in Your case. On the other hand, You really should think twice before doing so. There's actually a good reason for django orm not to delete the actual file after the corresponding

Re: ImageField not deleted while changing

2011-02-27 Thread Borislav Petrović
As far as I know, you should implement the file deletion by yourself. You should code it on the Models delete function. preserving the default behaviour. here is a link to some read: http://docs.djangoproject.com/en/dev/topics/db/models/#overriding-model-methods How you do the file deletion is

ImageField not deleted while changing

2011-02-26 Thread galago
Why old file is not deleted if I want to change it? I select new file in form and it's saved but old file is not deleted. Is it my fault or Django is designed not to delete it (if so, how to delete old file)? -- You received this message because you are subscribed to the Google Groups "Django

Admin save_model and ImageField (upload_to)

2011-01-10 Thread galago
Is there any way to get the full path of file, which will be uploaded? in save_model action i can get obj.image but it gives me only the file name. I want to get path with upload_to from model. Is it possible? I need it, because I want to make resizing on my image and make its name with hash to

ImageField, linking an already uploaded image with ImageField

2010-10-14 Thread reduxdj
I have an application that uses facebook's API, i'm grabbing the user's avatar image and storing it in my media folder. That's all good. What I want to do is associate the user's already uploaded image with the ImageField, without uploading the file. Is there a way do to do this with ImageField

problem with ImageField: Errno 45 Operation not supported

2010-07-05 Thread pod_person
I'm new to Django and I've been struggling with getting ImageField to upload images. I have a very simple model that I want to use to store images: class WriteupImage(models.Model): writeup=models.ForeignKey(Writeup) image = models.ImageField(upload_to="writeup/photos/") I h

Re: Importing ImageField from file or - better - generating it from another ImageField

2010-06-01 Thread Ricardo Bánffy
Thanks, Bill. I really had a hard time wrapping my head around the ImageField object model. I guess I am now OK, but I had to do more seek(0)'s than I wanted. It's sort of working and properly deduplicating images and thumbnails. I'll check the django-filebrowser product, tidy up what I have done

Re: Importing ImageField from file or - better - generating it from another ImageField

2010-06-01 Thread Bill Freeman
oblems wrapping my head around the ImageField field > type. I am trying to generate default thumbnails for uploaded images, > both stored as ImageField attributes. It's done this way because the > user must be able to manually edit the thumbnail if needed. > > I am failing mi

Importing ImageField from file or - better - generating it from another ImageField

2010-05-31 Thread Ricardo Bánffy
Hi folks I am having huge problems wrapping my head around the ImageField field type. I am trying to generate default thumbnails for uploaded images, both stored as ImageField attributes. It's done this way because the user must be able to manually edit the thumbnail if needed. I am failing

Re: ValueError on deleting a model object with an ImageField through Admin Interface

2010-05-13 Thread ryan west
I found the solution to my own problem. When the page was reloading, I am guessing that the actual entity had not been deleted yet, and the method __unicode__(self) was being called, requesting access of self.image (which did not exist, because that HAD been deleted). A simple modification to

ValueError on deleting a model object with an ImageField through Admin Interface

2010-05-13 Thread ryan west
I'm having a silly issue with the admin interface and an ImageField in one of my models. A simple model I have contains an ImageField, and many objects of this model are related to some other model (Project, not shown). I can add/view images just fine, but when I try to delete an image, I get

Re: What validation tests are applied to ImageField?

2010-03-22 Thread john2095
-based file sender) but I can still take advantage of the django.forms validation routines by invoking ImageField without a form. This seems to work: def upload(request): from django.forms import ImageField, ValidationError try: photo = ImageField().clean(request.FILES['Filedata

Re: What validation tests are applied to ImageField?

2010-03-22 Thread Tom Evans
On Mon, Mar 22, 2010 at 6:51 AM, john2095 wrote: > But does this all amount to an expectation that it will restrict the > upload to an image?? > > I've got this in my model: > > class Photo(models.Model): >    image = models.ImageField(upload_to='photos') > > and this in my

Re: What validation tests are applied to ImageField?

2010-03-22 Thread john2095
But does this all amount to an expectation that it will restrict the upload to an image?? I've got this in my model: class Photo(models.Model): image = models.ImageField(upload_to='photos') and this in my view: try: p = Photo() p.image = request.FILES['Filedata']

Re: Upload image file, resize using PIL, then save into ImageField - what to save to ImageField?

2010-03-19 Thread robinne
e > > "ProductFile" is a model) and "TempFile" is an ImageField: > > > uploadedfile = request.FILES['uploadfile'] > > ProductFile.objects.create(FileName=UploadDate=datetime.datetime.now(), > > TempFile=uploadedfile) > > > But, how do I manipulat

Re: Upload image file, resize using PIL, then save into ImageField - what to save to ImageField?

2010-03-19 Thread CrabbyPete
images. > > Alex > > On Mar 18, 12:10 am, robinne <develo...@computer-shoppe.net> wrote: > > > I can save an uploaded image to a FileField like this (where > > "ProductFile" is a model) and "TempFile" is an ImageField: > > > upl

Re: Upload image file, resize using PIL, then save into ImageField - what to save to ImageField?

2010-03-18 Thread Alex Robbins
gt; I can save an uploaded image to a FileField like this (where > "ProductFile" is a model) and "TempFile" is an ImageField: > > uploadedfile = request.FILES['uploadfile'] > ProductFile.objects.create(FileName=UploadDate=datetime.datetime.now(), > TempFil

Re: What validation tests are applied to ImageField?

2010-03-18 Thread john2095
Perfect. Thanks. That's what I was chasing. On Mar 17, 11:54 pm, Karen Tracey wrote: > > Validation of image fields is done at the form field level, see: > > http://code.djangoproject.com/browser/django/trunk/django/forms/field... > > Karen -- You received this message

Re: Upload image file, resize using PIL, then save into ImageField - what to save to ImageField?

2010-03-18 Thread bruno desthuilliers
On Mar 18, 6:10 am, robinne <develo...@computer-shoppe.net> wrote: > I can save an uploaded image to a FileField like this (where > "ProductFile" is a model) and "TempFile" is an ImageField: > > uploadedfile = request.FILES['uploadfile'] > Produ

Upload image file, resize using PIL, then save into ImageField - what to save to ImageField?

2010-03-17 Thread robinne
I can save an uploaded image to a FileField like this (where "ProductFile" is a model) and "TempFile" is an ImageField: uploadedfile = request.FILES['uploadfile'] ProductFile.objects.create(FileName=UploadDate=datetime.datetime.now(), TempFile=uploadedfile) But, how do I

Re: What validation tests are applied to ImageField?

2010-03-17 Thread thanos
DJango's ImageFields uses the PIL verify to check the image. trial_image = Image.open(file) trial_image.verify() See: http://www.pythonware.com/library/pil/handbook/image.htm On Mar 15, 10:56 pm, john2095 <john...@pobox.com> wrote: > The documentation states about the ImageField

Re: What validation tests are applied to ImageField?

2010-03-17 Thread Karen Tracey
On Wed, Mar 17, 2010 at 1:51 AM, john2095 wrote: > Maybe I should post this on the developers list? > No. The topic for django-developers is the development of Django itself. Questions about the use of Django are off-topic and will be directed elsewhere. Validation of image

Re: What validation tests are applied to ImageField?

2010-03-17 Thread pjrhar...@gmail.com
> What constitutes a 'valid' image? > The documentation states "ImageField... Like FileField, but validates > that the uploaded object is a valid image." I haven't read through the code, but the error must be caught somewhere because I just tested it out. Trying to upload in

Re: What validation tests are applied to ImageField?

2010-03-17 Thread Kenneth Gonsalves
On Wednesday 17 Mar 2010 11:21:45 am john2095 wrote: > Maybe I should post this on the developers list? Would that upset > them? > most of them read this list -- regards Kenneth Gonsalves Senior Associate NRC-FOSS http://certificate.nrcfoss.au-kbc.org.in -- You received this message because

Re: What validation tests are applied to ImageField?

2010-03-16 Thread john2095
errors pop up they are the side-effect of trying to establish the dimensions and not any specific attempt to validate the image against a set of criteria. For those who missed it my question it was: What constitutes a 'valid' image? The documentation states "ImageField... Like FileField, bu

Re: What validation tests are applied to ImageField?

2010-03-15 Thread creecode
Hello John, On Mar 15, 7:56 pm, john2095 wrote: > Question is "What is the definition of a 'valid image'" in this > context?" > and, optionally, where is the source code for that? My understanding from what I've read is that most of the heavy lifting for image handling is

What validation tests are applied to ImageField?

2010-03-15 Thread john2095
The documentation states about the ImageField "Like FileField, but validates that the uploaded object is a valid image. Has two extra optional arguments:" http://docs.djangoproject.com/en/dev/ref/models/fields/#imagefield I went cruising the source to try and work out what tests are i

Re: ImageField and built-in filesystem storage

2010-03-02 Thread thanos
You take a look at how I did things in http://code.google.com/p/django-googledata/ Thanos On Mar 2, 4:44 am, Xavier Ordoquy <xordo...@linovia.com> wrote: > Hi, > > I'm currently working on Django for a website on a legacy database but I'm > facing an issue on getting

Re: ImageField admin preview not working

2010-02-28 Thread lockwooddev
(r'^static/(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), the diffirence. (r'^static_media/(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), Thanks a lot!! :-) It cost me one day this tiny problem.. -- You

Re: ImageField admin preview not working

2010-02-28 Thread Malcolm Box
Read your settings.py file carefully: - you've said that the MEDIA_URL is / - but that Django is only configured to serve static content from /static So when the photo is uploaded, it's stored in /photos/x.jpg, which you've told Django is accessible via the URL /photos. But this gives

ImageField admin preview not working

2010-02-28 Thread lockwooddev
Hi people, I started working on an image gallery with Django and I'm stuck. I suppose that my static files on the development server are not configured properly. I have the following models.py code: from django.db import models from PIL import Image class Photo(models.Model): name =

Re: Custom button for imagefield form

2010-02-25 Thread Tom Evans
On Mon, Feb 22, 2010 at 1:06 PM, CrabbyPete wrote: > I have form with where users can upload an image. All works well but I > want a graphic instead of the default browse button that shows up. Can > I change it and if so how do you change it in the form field or > template?

Re: Custom button for imagefield form

2010-02-25 Thread rebus_
On 22 February 2010 14:06, CrabbyPete wrote: > I have form with where users can upload an image. All works well but I > want a graphic instead of the default browse button that shows up. Can > I change it and if so how do you change it in the form field or > template? > > >

Custom button for imagefield form

2010-02-22 Thread CrabbyPete
I have form with where users can upload an image. All works well but I want a graphic instead of the default browse button that shows up. Can I change it and if so how do you change it in the form field or template? class ProfileForm(SignUpForm): mugshot = forms.ImageField

Re: Binary Post Data to ImageField

2009-12-28 Thread Markus T.
After some digging, I finally worked it out. In case anyone is interested, here is the code for Django: from django.core.files.uploadedfile import SimpleUploadedFile def set_user_image(request, img_id): """ set/update a user's image """ if not request.user.is_authenticated(): return

Correct way to assing Images to ImageField field

2009-12-22 Thread Victor Loureiro Lima
ing error: *** ValueError: The 'foto' attribute has no file associated with it. Whats the correct approach for doing such a thing? I want to be able to associate a file from the disk with an specific ImageField field of my model. Any ideas? Thanks in advance, Victor Lima -- You rec

Re: Binary Post Data to ImageField

2009-12-21 Thread 邓超
As I know Django can not save binary data with it's default orm, you can try to select another orm like sqlalchemy, or you can try to modify the orm to make it can save binary data. 2009/12/21 Markus T. > Hi, > > I'm trying to save binary POST data to an ImageFile

Binary Post Data to ImageField

2009-12-21 Thread Markus T.
Hi, I'm trying to save binary POST data to an ImageFile field - so far with no satisfying success. I can't seem to convince the client (Flex based image editor) to send binary data as correct "multipart/form-data"; I only have the option to send as raw binary data or with POST variables. My

Re: Populating an ImageField

2009-10-03 Thread Nan
Thanks. For a simpler case than what I'm dealing with, yes, that would probably work. On Oct 3, 2:21 pm, kmike <kmik...@googlemail.com> wrote: > If you have one default logo then maybe the 'right' way is to use > 'default' parameter of ImageField? > > On 3 окт, 22:07, Nan &

Re: Populating an ImageField

2009-10-03 Thread kmike
If you have one default logo then maybe the 'right' way is to use 'default' parameter of ImageField? On 3 окт, 22:07, Nan <ringe...@gmail.com> wrote: > Nope, but I finally found what seems to be the "right" way to do this > (copies the file to the appropriate upload_to lo

Re: Populating an ImageField

2009-10-03 Thread Nan
Nope, but I finally found what seems to be the "right" way to do this (copies the file to the appropriate upload_to location, etc): from django.core.files.base import File def create_a_company(name, logo_path): company = Company() company.name = name logo_file = open(logo_path)

Re: Populating an ImageField

2009-10-02 Thread akonsu
did you try company.logo = relative_path ? On Oct 2, 4:45 pm, Nan wrote: > OK, this seemed to work: > > def create_a_company(name, logo_path): >     company = Company() >     company.name = name >     relative_path = path_relative_to_media_root(logo_path) >    

Re: Populating an ImageField

2009-10-02 Thread Nan
> company.save() > > On Oct 2, 4:15 pm, akonsu <ako...@gmail.com> wrote: > > > hello, > > > try setting the logo.url property. i do it with FileFields all the > > time and it works. > > > konstantin > > > On Oct 2, 4:12 pm, ringemup <rin

Re: Populating an ImageField

2009-10-02 Thread Nan
pm, akonsu <ako...@gmail.com> wrote: > hello, > > try setting the logo.url property. i do it with FileFields all the > time and it works. > > konstantin > > On Oct 2, 4:12 pm, ringemup <ringe...@gmail.com> wrote: > > > Say I have an image file on disk and a

Re: Populating an ImageField

2009-10-02 Thread akonsu
hello, try setting the logo.url property. i do it with FileFields all the time and it works. konstantin On Oct 2, 4:12 pm, ringemup <ringe...@gmail.com> wrote: > Say I have an image file on disk and a model that uses an ImageField. > If I want to create a model instance with tha

Populating an ImageField

2009-10-02 Thread ringemup
Say I have an image file on disk and a model that uses an ImageField. If I want to create a model instance with that image file in the image field without explicitly running through a form and a POST operation, how could that be done? Example of what I'm trying to accomplish: class Company

Re: ImageField anti-duplication

2009-09-20 Thread A. Rossi
> >         self.image.seek(0) > > >         return "images/%s%s" % (hashlib.sha256(self.image.read > > > (self.image.size)).hexdigest(), extension[1]) > > > >     image = models.ImageField(upload_to=imgurl, blank=True) > > > > what I am att

Re: ImageField anti-duplication

2009-09-12 Thread A. Rossi
empting to do is, if a user uploads an image that already > > exists (i.e. the two files have the exact same SHA256 hash) I want to > > have the ImageField point to the already existing file, rather than > > save the newly uploaded one. I have tried a couple things that didn't > >

Re: ImageField anti-duplication

2009-09-12 Thread vinilios
empting to do is, if a user uploads an image that already > exists (i.e. the two files have the exact same SHA256 hash) I want to > have the ImageField point to the already existing file, rather than > save the newly uploaded one. I have tried a couple things that didn't > work, and th

ImageField anti-duplication

2009-09-12 Thread A. Rossi
two files have the exact same SHA256 hash) I want to have the ImageField point to the already existing file, rather than save the newly uploaded one. I have tried a couple things that didn't work, and the default behavior when dealing with files of the same name is to append an extra _ to the end o

Re: Imagefield, PIL and save()

2009-09-03 Thread aa56280
On Sep 3, 5:31 pm, Rob Broadhead wrote: > If you are on a Mac there are some issues with the imagelib you will   > need to fix. Very interesting. I am on a Mac. So I'll investigate and update. Thanks, Rob. --~--~-~--~~~---~--~~ You

Re: Imagefield, PIL and save()

2009-09-03 Thread Rob Broadhead
that myself so my recollection may be a bit off. On Sep 3, 2009, at 5:23 PM, aa56280 wrote: > > I have an ImageField in a model. I also have a ModelForm for this > model. I'm overriding save() so that I can take the image that was > uploaded and make a thumbnail out of it using PIL. &

Imagefield, PIL and save()

2009-09-03 Thread aa56280
I have an ImageField in a model. I also have a ModelForm for this model. I'm overriding save() so that I can take the image that was uploaded and make a thumbnail out of it using PIL. I'm using the simplest of examples just to get started: ... def save(self): from PIL import Image im

Re: Store ImageField file using id as filename

2009-08-30 Thread Gonçalo Ferreira
: > > I'm trying to store images using the admin interface with the id as > > the filename. > > > > class ProductImage(models.Model): > > image = ImageField(upload_to=get_path) > > > > def get_path(self, filename): > > return 'product

Re: Store ImageField file using id as filename

2009-08-29 Thread Mike Ramirez
On Saturday 29 August 2009 04:03:58 pm gon...@gmail.com wrote: > I'm trying to store images using the admin interface with the id as > the filename. > > class ProductImage(models.Model): > image = ImageField(upload_to=get_path) > > def get_path(self, filena

Store ImageField file using id as filename

2009-08-29 Thread gon...@gmail.com
I'm trying to store images using the admin interface with the id as the filename. class ProductImage(models.Model): image = ImageField(upload_to=get_path) def get_path(self, filename): return 'product_images/%s.jpg' % self.id However, the images get stored as 'product_images

Re: ImageField width_wield

2009-08-29 Thread Léon Dignòn
No, everything is fine. Once you uploaded a file, you can call image.width and image.height (where image is an instance of Image). If you are using ModelForms, you can set editable=False as a parameter for width and height. image = models.ImageField(upload_to='images',

ImageField width_wield

2009-08-26 Thread TheIvIaxx
Assume i have the following: class Image(models.Model): image = models.ImageField(upload_to="path/to", width_field="width", height_field="height" do i create new Integer fields there for width and height? With this i can do things like: >>> Image.objects.get(pk=1).image.width However

Re: JSON Serialization with ImageField

2009-08-24 Thread Lewis Taylor
g 4, 2009 at 10:58 PM, scuzz<garethpri...@gmail.com> wrote: > > > > Hi, > > > > I'm trying to receive a file encoded in a json string and store it in > > an ImageField. I was hoping to use the standard Django deserialisation > > like: > > > > se

Re: JSON Serialization with ImageField

2009-08-24 Thread Maksymus007
On Tue, Aug 4, 2009 at 10:58 PM, scuzz<garethpri...@gmail.com> wrote: > > Hi, > > I'm trying to receive a file encoded in a json string and store it in > an ImageField. I was hoping to use the standard Django deserialisation > like: > > serializers.deserialize("

Re: JSON Serialization with ImageField

2009-08-24 Thread Lewis Taylor
Did you find a way to do this? I'm having the same problem. Lewis On Aug 4, 9:58 pm, scuzz <garethpri...@gmail.com> wrote: > Hi, > > I'm trying to receive a file encoded in a json string and store it in > an ImageField. I was hoping to use the standard Django dese

Re: ImageField woes

2009-08-22 Thread Léon Dignòn
If you need it only for one particular form, you can also override clean_(): --- import Image # PIL class UserProfileForm(ModelForm): class Meta: model = UserProfile # Model UserProfile has an ImageField named avatar. def clean_avatar(self

ImageField woes

2009-08-21 Thread Jon
I want to expand on the ImageField functionality of django. Mainly, I want to check the dimensions of the image the user is uploading, and resize / crop where appropriate. I would also like to set compression amount, and perhaps even allow for watermarking. I know there are several libraries out

How to add an imagefield from script

2009-08-21 Thread Francis
Hi, I have a model with an imageField that is working fine when using the admin interface. But I'm trying to make a script that load a bunch of image from a flat file. I can't make it works, the entry get created with a "valid" link to the image as configured with the "upload

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

Re: PIL & imagefield validation

2009-08-19 Thread zayatzz
ave 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. > >

Re: PIL & imagefield validation

2009-08-18 Thread Malcolm MacKinnon
. 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. > > B

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

Re: PIL & imagefield validation

2009-08-18 Thread zayatzz
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_ws

Re: PIL & imagefield validation

2009-08-18 Thread Michael
L. 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

Re: PIL & imagefield validation

2009-08-18 Thread zayatzz
thon-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: >

PIL & imagefield validation

2009-08-17 Thread zayatzz
rted 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 imp

Default Image when ImageField is empty

2009-08-15 Thread Leo
Hi all, I would like to know what I need to do to fill an ImageField with a default image when the user does not submit any on the form. thanks, Leo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

JSON Serialization with ImageField

2009-08-04 Thread scuzz
Hi, I'm trying to receive a file encoded in a json string and store it in an ImageField. I was hoping to use the standard Django deserialisation like: serializers.deserialize("json", "...snip..., \"myImageField\": \"base64encodedimage\", ...snip...) however

Re: ImageFile bug? (Re: ImageField questions)

2009-07-28 Thread Jacob Kaplan-Moss
On Sun, Jul 26, 2009 at 11:10 PM, Rusty Greer wrote: > i applied the patch you mentioned before (to my 1.0.2 release): Yeah, the fix is predicated on some file storage refactoring that's too intensive to reach the 1.0.X series. You'll need to upgrade to 1.1 to get the fix.

Re: python 2.5 --> 2.3, now imagefield error

2009-07-27 Thread Cody Django
yes, and it contains the jpg and gif plugins, which I assume means that it does support jpgs. On Jul 27, 9:15 pm, Darryl Ross wrote: > Cody Django wrote: > > ImageFields worked just fine until I moved to a new server. Now I get > > error messages "Upload a valid image". I

Re: python 2.5 --> 2.3, now imagefield error

2009-07-27 Thread Cody Django
checked: - pil supports jpgs - permissions set to 775 on upload folders On Jul 27, 7:44 pm, Cody Django <codydja...@gmail.com> wrote: > All imagefields give this error: Upload a valid image. The file you > uploaded was either not an image or a corrupted image. > > I suspe

Re: python 2.5 --> 2.3, now imagefield error

2009-07-27 Thread Darryl Ross
Cody Django wrote: > ImageFields worked just fine until I moved to a new server. Now I get > error messages "Upload a valid image". I know the images are fine, > the media root and www_url are correct, so what else could this be? > Ideas are greatly appreciated! Do you have PIL installed on the

python 2.5 --> 2.3, now imagefield error

2009-07-27 Thread Cody Django
All imagefields give this error: Upload a valid image. The file you uploaded was either not an image or a corrupted image. I suspect that imagefield itself is compatible with python 2.3, so where else could the problem be? It's not with the image. Ideas are greatly appreciated... Thanks

python 2.5 --> 2.3, now imagefield error

2009-07-27 Thread Cody Django
ImageFields worked just fine until I moved to a new server. Now I get error messages "Upload a valid image". I know the images are fine, the media root and www_url are correct, so what else could this be? Ideas are greatly appreciated! Cody

Re: ImageFile bug? (Re: ImageField questions)

2009-07-27 Thread Rusty Greer
On Sun, Jul 26, 2009 at 10:28 PM, Jacob Kaplan-Moss wrote: > > 2009/7/24 Rusty Greer : >> that bug actually doesn't fix my case.  if i alter the patch to just >> do a file.close() in all cases, it works.  is there another patch to >> close the file opened

Re: ImageFile bug? (Re: ImageField questions)

2009-07-26 Thread Jacob Kaplan-Moss
2009/7/24 Rusty Greer : > that bug actually doesn't fix my case.  if i alter the patch to just > do a file.close() in all cases, it works.  is there another patch to > close the file opened outside of this class? I'm not sure I follow; let me make sure I understand you: *

Complex customization using generic views involving ImageField and ForeignKey(User)

2009-07-26 Thread djangonoob
I would like to use generic views to allow users to upload images, with the image linked ( via ForeignKey ) to the user id. The following is my code: ( a link to dpaste is here: http://dpaste.com/71693/ ) # models.py class PressRelease(models.Model): title = models.CharField(max_length=100)

Re: ImageFile bug? (Re: ImageField questions)

2009-07-24 Thread Jacob Kaplan-Moss
On Fri, Jul 24, 2009 at 8:23 AM, Rusty Greer wrote: > from what i can tell, get_image_dimensions in > django/core/files/images.py seems to open the files but never closes > them.  is this a bug? Yes, it was #8817 (http://code.djangoproject.com/ticket/8817) which was fixed a few

ImageFile bug? (Re: ImageField questions)

2009-07-24 Thread Rusty Greer
On Thu, Jul 23, 2009 at 5:55 PM, Joshua Russo wrote: > On Thu, Jul 23, 2009 at 9:31 PM, Rusty Greer wrote: >> >> how do i create a query on the size of an image? >> >> for example: >> class Image(models.Model): >> >>    image =

<    1   2   3   4   5   6   >