[Archetypes-users] plone.app.blob image sizes

13 views
Skip to first unread message

Andreas Stocker

unread,
Aug 1, 2012, 3:59:21 AM8/1/12
to archetyp...@lists.sourceforge.net
Hi!

I've run into trouble using the ImageField of plone.app.blob. It seems that it does not support image sizes, or at least I cannot access it via an URL in the browser. I'm using following code (incomplete snippet):

from plone.app.blob.field import ImageField as BlobImageField

MyTypeSchema = folder.ATFolderSchema.copy() + atapi.Schema((

    BlobImageField(
        'myimage',
        languageIndependent=True,
        storage=atapi.AttributeStorage(),
        widget=atapi.ImageWidget(
            label=_(u"Image"),
        ),
        sizes={
            'icon'     : (32,32),
            'mini'     : (64,64),
            'small'    : (128,128),
            'preview'  : (256,256),
            'medium'   : (512,512),
            'banner'   : (1024,1024),
            'original' : (1024,1024),
        },
        original_size=(1024,1024),
        pil_quality=90,
        required=True,
        validators=('isNonEmptyFile'),
    ),
    
))

Proof me wrong, but shouldn't I be able to access the image via an URL like http://localhost/mysite/mytype/myimage_preview. Is this really not supported by the blobstorage product, or am I missing something important?

Mikko Ohtamaa

unread,
Aug 1, 2012, 4:31:45 AM8/1/12
to Andreas Stocker, archetyp...@lists.sourceforge.net
On Wed, Aug 1, 2012 at 11:31 AM, Mikko Ohtamaa <mi...@opensourcehacker.com> wrote:

Proof me wrong, but shouldn't I be able to access the image via an URL like http://localhost/mysite/mytype/myimage_preview. Is this really not supported by the blobstorage product, or am I missing something important?

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Archetypes-users mailing list
Archetyp...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/archetypes-users




--
Mikko Ohtamaa
http://opensourcehacker.com
http://twitter.com/moo9000

--
Mikko Ohtamaa
http://opensourcehacker.com
http://twitter.com/moo9000



Andreas Stocker

unread,
Aug 1, 2012, 11:41:03 AM8/1/12
to archetyp...@lists.sourceforge.net
Thanks, that worked perfectly!



Proof me wrong, but shouldn't I be able to access the image via an URL like http://localhost/mysite/mytype/myimage_preview. Is this really not supported by the blobstorage product, or am I missing something important?
Reply all
Reply to author
Forward
0 new messages