NamedFile/NamedImage not using blobstorage

As part of a Plone 5 importers we generate named image/files using

img = NamedImage(img_data, contentType='img/png', filename="...")
setattr(new_obj, 'image', img)

However the images are being stored within the Data,fs instead of the blobstorage which is properly configured

<zodb_db main>
    # Main database
    cache-size 30000
    # Blob-enabled FileStorage database
    <blobstorage>
      blob-dir /home/vmadmin/share-migration/var/blobstorage
      # FileStorage database
      <filestorage>
        path /home/vmadmin/share-migration/var/filestorage/Data.fs
      </filestorage>
    </blobstorage>
    mount-point /
</zodb_db>

Any idea?

Andreas

I've noticed the same thing when using c.xsendfile. Only when accessing the raw original image will it load from a blob (and therefore trigger c.xsendfile).
If it's by design, seems a strange choice. You might be better off raising an issue on the code itself?

Sorry but I don't understand your reply.

But appearently there is NamedFile|NamedImage and NamedBlobFile]NamedBlobImage ...likely thats the problem here.

Andreas

Resolved...as guessed:: NamedBlobImage+File was needed here.

For reference, here is how plone.app.contenttypes uses this in its Image schema: https://github.com/plone/plone.app.contenttypes/blob/master/plone/app/contenttypes/schema/image.xml#L16 or in code https://github.com/plone/plone.app.contenttypes/blob/master/plone/app/contenttypes/content.py#L127

Plone Foundation Code of Conduct