My client has a problem recognising what is a PDF and what is a jpg.
Obviously there's no cropping on a PDF file and blows the layout and displays "as is".
Is there a way of restricting type="image" to uploading only true web images?
My client has a problem recognising what is a PDF and what is a jpg.
Obviously there's no cropping on a PDF file and blows the layout and displays "as is".
Is there a way of restricting type="image" to uploading only true web images?
It remained as a PDF. Perch does no rendering/resizing on PDF's which I'd expect.
Safari displays PDF's in the browser using the IMG tag and blows the layout as the size was specific.
Firefox and other browsers do not display PDF's and nothing appear in Perch either so the client is unaware of the problem.
I haven't tried this out but you could try adding the 'file-type' attribute found on 'type="file" field types? long shot but it might work. So you'd have something like:
You could settle for using 'file' field type and forgo the resizing/cropping and use some frontend markup/css to crop and resize. Not ideal I know but at least it would limit the 'PDF damage'...
The file-type attribute filters existing assets in the asset chooser. I think the editor can still upload PDF files.
It's not ideal that Perch allows selecting PDFs in an image field. One option could be to add a conditional to not render the PDF files at all so the user is forced to pick an image instead:
The above doesn't really cover all cases because it will also match any file path of an image that contains .pdf like /perch/resources/my.pdf_elephant.jpg.