8 ms·
I thought iOS was supposed to convert HEIC images to JPEG automatically behind-the-scenes in any file transfer situation where HEIC isn't supported. The article
by crazygringo 7y ago
I thought iOS was supposed to convert HEIC images to JPEG automatically behind-the-scenes in any file transfer situation where HEIC isn't supported. The article itself even says:
> iPhones convert HEICs to JPEGs automatically when they’re attached to emails in the Mail app
I'm just curious technically why the same didn't happen with the testing portal? If you have a webpage that accepts image uploads, is iOS Safari not smart enough to do the same conversion?
Or was the portal programmed badly or in a non-standard way that that couldn't happen? Or is there a way to do it that the developers ignored?
Just curious for the technical details of who's more to blame here -- Apple not providing enough backwards compatibility, or the testing portal being designed poorly.
Because blaming students for not following obscure instructions to change their phone's overall configuration is not the right path. A national testing portal ought to support the default image format taken by the world's most popular phone, period.
- danso 7y agoWould it be correct for iOS Safari to quietly reencode to jpeg when a HEIC file is uploaded via a webform? How would Safari know that the site's backend didn't want an HEIC file? I agree the HEIC thing is very confusing (having set up my parents' phones recently), but I can't see how Apple is to blame. For starters, the College Board could've done a much better job emphasizing this step for iOS users in its instructions page. But for me, the overriding factor that places blame squarely on the College Board is this from the article: > Senior Dave Spencer took a demo test before his Calculus AB exam to make sure he understood the process for uploading photos. He Airdropped an iPhone image of his responses to his Mac and tried to convert it by renaming the HEIC file to PNG. Changing a file’s extension does not guarantee that it will be converted, but Spencer was still able to submit the demo test with no problem. > Spencer used the same process on the real exam and thought it went through, but he received an email the next day saying the files were corrupted and that he needed to retake the test. So it seems that students had access to a demo before test day. If I'm reading the story right: - During the demo, Dave's phone produced a HEIC file - The demo upload initially failed. So Dave renamed the file extension to PNG. - Dave uploaded the PNG (in name only), and the demo did not return an error. - Dave assumed, quite understandably, that the renaming trick would work on test day too. So the onus in the College Board here: they provided a demo in which the photo upload function appears to have been stubbed (e.g. "if 'PNG|JPG|JPEG' is filename, print "Success"), giving students and teachers false assurance that photo uploads would work on test day.
- fortran77 7y agoDoes the HTTP "accept" tag play a role here? https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Ac...
- Aqua_Geek 7y agoI don't follow. How does the "Accept" header factor in here?
- tobylane 7y agoRule of least astonishment would be that the file is converted unless the accept header lists the heif file. At least by the expectations Apple set up, which don’t match up with standards.
- detaro 7y agoThat's a header the client sends to a server to indicate which formats it would like in the response to it's requests, and not relevant to the problem.
- derefr 7y ago> they provided a demo in which the photo upload function appears to have been stubbed (e.g. "if 'PNG|JPG|JPEG' is filename, print "Success"), giving students and teachers false assurance that photo uploads would work on test day. I don't think it was exactly that it was stubbed out, per se; I would guess it was that the whole "backend" process involved either a human or an async batch process opening the file; and so in both the demo and prod environments, the upload of a file can succeed while the parsing of said file can fail (much later on, after the test is completed, during the grading phase.)
- danso 7y agoYeah, I agree with you that the production app likely had an async process, i.e. queuing submissions and processing them first-come-first-serve, which would help explain why Dave didn't get the failure email until well into the next day. Seems safe to assume there was no process for (good) input validation upon upload. And now that I reread the passage about Dave, I realize it's not necessarily true that Dave tried to upload HEIC, then got an error message, which led him to then rename the file. But he may have actually read the instructions about PNG/JPG being required, then thought he could just rename his file, then uploaded it as his first and only upload to the demo app. And whether the demo app actually did the upload, it apparently didn't do the parsing (I still think that was stubbed out; I can imagine an engineer thinking it'd save a headache if they disabled the parsing module for the demo server)
- somehnguy 7y agoProbably not. If I Airdrop photos taken on my phone to my Macbook they arrive in HEIC format. I have to use an external tool (iMazing HEIC Converter) to manually convert them for a bunch of places.
- deleted 7y ago[deleted]
- crazygringo 7y agoI've experienced that with AirDrop too, but that's because the iPhone knows the Mac can view them. Also you don't need an external tool -- Preview will convert HEIC to JPEG for you relatively instantly, even in batch. (Though I really do wish the phone would ask first if you want to convert, when Airdropping.)
- somehnguy 7y agoI'll try Preview next time instead, thanks! iMazing works fine for the actual functionality but has some sort of bug where it won't re-open if I closed it without force quitting it. Minor but annoying.
- CamJN 7y agoThat's likely an issue with iMazing not properly handling apple's saved ui state mechanism. You could try checking if holding the option key reveals a "quit and close all windows" option in the app's eponymous menu item, or press and hold the Shift key while opening the app to forget previous UI state. If you don't care for apps to remember their previous windows and ui state, you can disable this mechanism in the settings app: https://support.apple.com/en-ca/HT204005#appresume https://support.apple.com/en-ca/HT204005#appresume
- oefrha 7y agoTried a standard input tag with the proper accept attribute <input type="file" accept="image/jpeg,image/png" /> Selected a HEIC file from Photos in Safari, the selected image was automatically converted to JPEG. Ten bucks says College Board programmer(s) failed to do the most basic and standard filtering. Edit: Like a sibling comment said, the accept attribute actually isn't necessary; even PNG images (e.g. screenshots) from Photos are converted to JPEG automatically. This is true on both macOS and iOS Safari (latest). To be clear, on macOS you need to select from Photos instead of the filesystem for this to take effect. In case anyone's interested, source code you can use to test for yourself (a Flask app): app.py: import flask app = flask.Flask(__name__) @app.route("/", methods=["GET", "POST"]) def index(): if flask.request.method == "POST": image = flask.request.files["image"] return f"uploaded {image.filename!r} ({image.mimetype})" return flask.render_template("index.html") templates/index.html: <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> </head> <body> <form method="post" enctype="multipart/form-data"> <input name="image" type="file" required /> <input type="submit" /> </form> </body> </html>
- diebeforei485 7y agoIs this the case on both Desktop and Mobile Safari?
- oefrha 7y agoYes, see edit.
- winter_blue 7y agoWow, I didn't know browsers even supported automatic image format conversion (this is pretty impressive IMO). Terrible that their programmers didn't specify that tag attribute.
- dave5104 7y agoI don't believe that's what's happening here. The accept attribute just filters what files show up in the file picker. And iOS devices will take an extra step, and on the operating system side convert HEIC files to JPEG.
- gsnedders 7y ago> If you have a webpage that accepts image uploads, is iOS Safari not smart enough to do the same conversion? AIUI, Mobile Safari always re-encodes the image. However, if you transfer the image to a device that supports HEIC (e.g., recent macOS) then you'll find out that (desktop) Safari never re-encodes an image when uploading a file.
- oefrha 7y ago> (desktop) Safari never re-encodes an image when uploading a file. Not really: https://news.ycombinator.com/item?id=23261216 https://news.ycombinator.com/item?id=23261216 Images are converted if you select from Photos (instead of the filesystem).
- pdonis 7y ago> A national testing portal ought to support the default image format taken by the world's most popular phone, period. What if it can't because the format is proprietary and Apple wants to charge for its use? As I understand it, MS and Google have to pay licensing fees to enable support for it in Windows 10 and Android.
- guptaneil 7y agoYou're thinking of HEVC (video encoding, like h.265): https://en.wikipedia.org/wiki/High_Efficiency_Video_Coding#Patent_license_terms https://en.wikipedia.org/wiki/High_Efficiency_Video_Coding#P... HEIC (image encoding) is available without royalties: https://en.wikipedia.org/wiki/High_Efficiency_Image_File_Format#Patent_licensing https://en.wikipedia.org/wiki/High_Efficiency_Image_File_For... Regardless, in this case, as others noted, iOS would have just converted to jpg if College Board was using a standard image upload form.
- ungzd 7y ago> When containing images and image sequences encoded in a particular format (e.g. HEVC or AVC) its use becomes subject to the licensing of patents on the coding format.
- guptaneil 7y agoI'm not sure what you're trying to say with that quote? As I mentioned, HEVC is subject to licensing costs. If you try to wrap your HEVC video content in an HEIC container, you don't suddenly get to skip paying the original licensing costs.
- noisem4ker 7y agoHe's trying to remark the fact that HEIC = HEIF(HEVC) => non-free. See my other reply to your first comment. Note that HEVC doesn't necessarily mean video. It can be used to compress still images, as it's the case of Apple devices.
- 7y ago
- acdha 7y agoHistorically, Safari always converted to JPEG and I don't think that required something like setting the accept attribute (e.g. <input type="file" accept="image/jpeg">). It's not clear whether they're using something like the JavaScript blob APIs to get the file contents without some implicit conversion.
- NikolaNovak 7y agoFWIW, as is the norm, my experience is that it works brilliantly --as long as you stay within apple defaults. As soon as I stray from golden path - text using anything but Apple MEssages, email using anything but apple mail, post using anything but safari, use/process with anything but Apple Photos - HEIC has been an absolute positive pain in my keister ;-( Other people may have more luck; note that my work iPhone is an isolated island - my other devices are either Android, or Windows/Linux - which probably explains my troubles to a large degree. Apple's selling point has always been the well-integrated ecosystem so I understand I'm an outlier.
- beezle 7y agoWhich is why IOS should default to sending JPG or PNG to/between any non-bespoke Apple product until such a time that HEIC is universally common. That should be transparent to both the end-user as well as the receiving end. One can moan about the test site not being more robust/careful but it is Apple/Samsung that are using the new, non-standard format and expecting others to accomodate in short order.
- scott_s 7y agosnazz posted the actual code downthread: https://news.ycombinator.com/item?id=23261598 https://news.ycombinator.com/item?id=23261598 My guess is that the JavaScript manually checking the filename's extension is screwing up the automatic conversion.
- wlesieutre 7y agoThe article reads to me like the people who had problems sent the images from the phone to their computer, which may not trigger the automatic conversion? One air dropped it to the computer and renamed it PNG, another renamed it JPEG, but they were probably HEIC files with the wrong file extension.
- hundchenkatze 7y agoI believe those students had received noticed to use png/jpeg, and their solution was to change the file extensions. The website accepted them without issue, but these students later received emails telling that their photo was corrupt. The other, unaware students tried to upload the HEIC directly from their phones and the website stopped responding causing their test time to expire.
- wlesieutre 7y agoAh gotcha, I think you're right. Sheesh.
- mokus 7y agoWow, I have been using iOS (and keeping it up to date) and macOS and Photos.app and uploading images to sites regularly for quite some time and this is the first time I’ve ever even heard of HEIC. Whatever they are doing has been beyond seamless for me.