Forum

Thread tagged as: Question

Reuse existing image in 'resources'

I'd like, sometimes, to use images which I've worked on, via a perch tag in a template, without Perch doing anything at all to the image when the edit in the perch interface is saved. Also, in a template which contains a perch tag type="image" the editor will be offered the choice to Select or Upload an image, but if you choose an image which is already in the 'resources' bucket (from the Asset pane on the right of the editing window) then the image will be recreated even if the use is identical to the image which is already there. Is there a way to use an existing Asset without it being either duplicated or reprocessed? Excuse if this is covered in documentation or the forum - I've searched but can't find clear explanations of this.

Peter Hammarling

Peter Hammarling 0 points

  • 4 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

If the image is the exact same size as the previous one then we use it, if you specify different sizes then we create one at the new size.

Thanks Rachel. I couldn't initially make that happen but I must have been causing some slight difference in the image - I see from further testing that no new image is created if the specs in the perch image tag are identical. But, and I guess this is a separate issue, I still find that when the original is imported into the 'resources' folder via Add asset, it does seem to be processed in some way - the file size of my original jpeg is not the same as the file size of the image in 'resources'.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok - is there a question that you're still looking for help with?

Yes. Is there a way to upload an image via perch so that it isn't reprocessed in any way?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Are you adding width and height attributes to the tag?

Images could be styled only by the css, there wouldn't necessarily be a need for size info in the perch tag.

Rachel Andrew

Rachel Andrew 394 points
Perch Support

They are optional on the tag itself, so don't add them if you don't want Perch to resize the image. Otherwise we take that as an instruction.

OK, understood, thanks. It would be useful if there were more info in the documentation explaining these details of image management.

There are still aspects that I find quite confusing. For example, if you re-use an image that Assets already knows about in the resources folder, say, via the image icon in a textile field, an exact duplicate of the image is created.

Anyway, this isn't a question so no need to respond and thanks for the explanations.