Resizing documents when uploaded

Hi all,

We have a few clients who upload high resolution images (very large files at > 72 dpi) to their SPIP sites as documents. As we don't really have the time to train them and they don't have the software to resize and resample their images, we're wondering if there is a SPIP plug-in that does this?

Ideally, the plug-in would resample (and, optionally, resize) an image when it is uploaded and store the new, smaller version instead of the high resolution original.

If there is not, we'll need to develop a plug-in to do this. I had a very quick check on <http://doc.spip.org/> and a grep through the code but couldn't find a pipeline that will be triggered on document upload. Is there a pipeline that gets called when documents are uploaded?

Regards,

Thomas Sutton

Web Developer
bouncingorange
graphic + web design

We have a few clients who upload high resolution images (very large files at

72 dpi) to their SPIP sites as documents. As we don't really have the time

to train them and they don't have the software to resize and resample their
images, we're wondering if there is a SPIP plug-in that does this?

Hi Thomas,

have a look at ecrire/inc/ajouter_documents.php there is a test
already for _IMG_MAX_WIDTH and _IMG_MAX_HEIGHT ; here instead of
returning an error it would be easy to do an automatic resizing.

I don't think there's a plugin already, but it's certainly a very good idea.

Is there a pipeline that gets called when documents are uploaded?

No but it's going to be a one-line add, once we decide where best to insert it

-- Fil