2.x Uploaded image increases in size and ignores image: false
See original GitHub issueTo Reproduce
Upload any image file through the Apostrophe UI.
Expected behavior
I would like to upload image files without any modifications, optimisations or compressions. I would like to eventually use it as follows: {{ apos.attachments.url(data.widget._backgroundImage.attachment, { size: 'original' }) }}
Describe the bug
However, when I upload a 300KB JPG file, I get the “original” file with 1.7MB in size.
Details
Version of Node.js: v14.17.0
Server Operating System: MacOS Catalina
Additional context:
apostrophe-attachments
configuration
'apostrophe-attachments': {
svgImages: true,
fileGroups: [
{
name: 'images',
label: 'Images',
extensions: ['png', 'gif', 'jpg', 'svg'],
extensionMaps: { jpeg: 'jpg' },
image: false
},
👆 Notice that there is image: false
, so it should not treat it as an image and hence not created scaled versions of the file.
I am not using ImageMagic – I am going to try and give an update if it helps.
Screenshots Original file:
File on the server (with the scaled image versions too):
Issue Analytics
- State:
- Created 2 years ago
- Comments:22 (22 by maintainers)
Top GitHub Comments
copyOriginal and orientOriginals would need to be nested inside an “uploadfs” sub-option.
I would not recommend “copyOriginal: false” because it would have the surprising result of preventing Apostrophe from ever rescaling if you add more sizes or make crops with the UI later etc. It’s an uploadfs feature but not one that is recommended for Apostrophe.
On Tue, Jul 6, 2021 at 10:28 AM stepanjakl @.***> wrote:
–
THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER APOSTROPHECMS | apostrophecms.com | he/him/his
TIL (Today I Learned): modern browsers apparently do support exif rotation hints by default. IE11 does not however, and is still unfortunately supported by some projects at least into 2022 when Microsoft will stop supporting it.
I’m not crazy though, this is very recent (2020, for Chrome):
https://www.chromestatus.com/feature/6313474512650240
https://developer.mozilla.org/en-US/docs/Web/CSS/image-orientation#browser_compatibility
On Tue, Jun 29, 2021 at 12:10 PM stepanjakl @.***> wrote:
–
THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER APOSTROPHECMS | apostrophecms.com | he/him/his