nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.21k stars 3.95k forks source link

Add ability to upload files in HEIC format from iOS devices via public links #30375

Open smasharov opened 2 years ago

smasharov commented 2 years ago

Is your feature request related to a problem? Please describe. A have created a public link for uploads on my nextcloud-php74-23.0.0. When I try to upload image file in HEIC format it automatically converts chosen files into JPEG format, making them larger in size by 2-3 times. I have checked Safari and Chrome. The situation is the same.

Describe the solution you'd like The chosen files must be uploaded in original format without any conversion and also it is good to keep original filename, now the filename is also changed to unreadable UID like A2F3F83C-A64D-413E-AF40-B19EB5BABE29.jpeg

Describe alternatives you've considered It looks like that the images are converted by iOS device itself because of compatibility. Maybe some kind of tags like allowed features should be reported to the mobile browser from the server to allow pass the image in the original HEIC format.

Additional context I had almost he same issue with other applications recently, All images were converted to JPEG from HEIC regardless of settings on the device. But recently it was fixed and now the images are sent without conversion in the original HEIC format.

Nirostar commented 2 years ago

This shouldn't be that hard. Unfortunately I can't find the code part where to look at. If someone could give me a starting direction which part of the codebase deals with upload to public links I will try to file a PR with the necessary changes.

Extarys commented 2 years ago

My friend who has an iPhone sends me pictures she takes through a Nextcloud public link. I thought only the name was a mess with the UID like above A2F3F83C-A64D-413E-AF40-B19EB5BABE29.jpeg and that it was jpeg instead of HEIC, sadly the timestamps of the pictures are either missing or wrong, and location data and other nice exif data are missing or incomplete :/ Makes it so finding a picture hard and the task of importing them in PhotoPrism a big pain.

TheBigNeo commented 2 years ago

I have tested this with different services (Dropbox, Synology, NextCloud) and they all behave the same. The problem is not with the upload service, but with the iPhone. The iPhone sends the image as a JEPG and loses the EXIF data.

heapxor commented 1 year ago

any update here?

heapxor commented 1 year ago

there are more bugs> https://help.nextcloud.com/t/camera-upload-completely-broken-while-uploading-photos-videos/143152

Mirkbot commented 1 year ago

Is there any plan to revisit this issue? Unfortunately having people upload pictures via public links is still converting it to jpg (droppen exif data and the original name). Despite image Magick being compiled with heic support (basically enabling nextcloud support for heic) iPhone uploads are still converted.

TheBigNeo commented 1 year ago

But the Problem is on the iPhone side. iPhone converts HEIC to JPG and drop all the meta data…. Stupid phone…

Mirkbot commented 1 year ago

I wonder since it seems that inside the nextcloud app on iPhone uploading the original heic photos is possible... Is there any way to achieve this with the share button inside nextcloud using an iPhone.

crstmkt commented 1 year ago

It already IS possible. Simply go to Settings->Enhanced (it maybe called otherwise. I'm using german version of Nextcloud IOS) and disable Maximum compatiblity. Now your pictures are uploaded as RAW / HEIC

EDIT: Typo

Nirostar commented 1 year ago

It already IS possible. Simply go to Settings->Enhanced (it maybe called otherwise. I'm using german version of Nextcloud IOS) and disable Maximum compatiblity. Now your pictures are uploaded as RAW / HEIC

EDIT: Typo

But this has nothing to do with browser uploads via a public link...

crstmkt commented 1 year ago

It already IS possible. Simply go to Settings->Enhanced (it maybe called otherwise. I'm using german version of Nextcloud IOS) and disable Maximum compatiblity. Now your pictures are uploaded as RAW / HEIC EDIT: Typo

But this has nothing to do with browser uploads via a public link...

You're right, my bad. I found this thicket while I was looking for a solution on how to upload RAW / HEIC pictures from the NC App. As soon as I found that, I thought I might share it and just read the ticket half way. Sorry for that.

joshtrichards commented 10 months ago

Can anyone dig up an official or semiofficial* source about what Apple is doing and what they expect third parties to do about this?

From the sounds of it, there are several points on Apple OSes where when uploads take place the device does the image conversion from HEIC->JPEG. They presumably did this in an attempt at compatibility since JPEG is way more prevalent.

But it's not clear what third parties (i.e. NC) are supposed to do - if it's even possible - to tell the client to not do the conversion.

From searching the web for answers, even setting accept in the upload form with the appropriate mime type (indicating a willingness to acceptance image/heic) does not prevent an Apple device from doing the conversion.

*(or at least authoritative in the sense that someone did the legwork to reverse engineer)