#known 2018-06-12

2018-06-12 UTC
[cleverdevil], [chrisaldrich], tantek, mapkyca and [jgmac1106] joined the channel
#
mapkyca
jeremycherfas: Got an example of this happening? Known will use the mime type of the original image, so either the original file was mis-detected on upload (prob because your server mime types aren't configured or the mime type hint library isn't installed), or headers are being squished on download
jeremych_ joined the channel
#
jeremycherfas
Let me check. It definitely happens with images from OwnYourGram, like this one https://stream.jeremycherfas.net/2018/result
#
jeremycherfas
Let me see if I have one uploaded directly
#
jeremycherfas
Allso true with other images via Micropub, eg https://stream.jeremycherfas.net/2018/untitled-13
#
jeremycherfas
But not, apparently, with images uploaded directly to Known, e.g. https://stream.jeremycherfas.net/2018/breadhead
#
jeremycherfas
Seems that when they come from somewhere else, image files do not get an extension, but when I upload them direct to Known, they do.
[kevinmarks] joined the channel
#
[kevinmarks]
so mime type is not coming through in micropub? Both multipart and media endpoint should be sending it
#
jeremycherfas
I guess not. I need to go and check my setting in Quill (and OYG?) to see if that is an option I have overlooked. But not for an hour or so.
#
jeremycherfas
Seems odd. Maybe Known's micropub is stripping it.
[pfefferle] and [cjwillcock] joined the channel
#
mapkyca
aye, possibly the micropub endpoint isn't setting mime correctly...
#
jeremycherfas
I'm looking here https://github.com/idno/Known/blob/master/IdnoPlugins/IndiePub/Pages/MicroPub/Endpoint.php#L122 but 'type' seems to refer to the type of post, not the type of file.
#
mapkyca
depends if it's a direct file upload or a json payload uploading the image via url. File upload should be fairly robust as that will take the mime from the browser reported content-type, but downloading via url depends on the remote server reporting the content type correctly...
#
jeremycherfas
I see. So need to look at what the remote server sends. Although I am not seeing anywhere in `endpoint.php` where $mimetype is added to filename as an extension. Or maybe it doesn't need to be.
tantek joined the channel
#
mapkyca
Mime is stored in the file store metadata, not as a file extension
#
jeremycherfas
Let me try for the final image as Known saves it.
#
jeremycherfas
Bingo `Content-Type: application/data`
#
jeremycherfas
!tell mapkyca When quill uploads the image to the temp storage, it is `Content-Type: image/jpeg`
#
Loqi
Ok, I'll tell them that when I see them next
#
aaronpk
i've seen this problem a lot in Known. it often tricks my avatar cache into saving files with the wrong extension because my cache looks at the mime type when it downloads the file
#
jeremycherfas
But when I look at the image link directly, it is `Content-Type: application/data`
#
aaronpk
jeremycherfas: so just to double check, the sequence to reproduce this was:
#
aaronpk
1) quill -> Known media endpoint: file is saved at the media endpoint with image/jpeg
#
jeremycherfas
Go to post a photo note in Quill.
#
aaronpk
2) quill -> Known Micropub endpoint JSON, tells Known the media endpoint URL: Known then copies the file and serves as application/data
#
jeremycherfas
When the image preview is showing and Quill shows the link, do `curl -I link-to-tempfile'
#
jeremycherfas
Content-Type: image/jpeg
#
jeremycherfas
Post the photo to Known.
#
jeremycherfas
Copy the link of the image as shown by Known.
#
jeremycherfas
Do `curl -I link-to-image`
#
jeremycherfas
Content-Type: application/data
#
jeremycherfas
So not quite. The image saved at the media endpoint is temporary. Known then saves it permanently elsewhere.
#
aaronpk
hopefully mapkyca can track this down with that information
#
jeremycherfas
I hope so. Is it worth my writing up? I can create an issue and stick it on my website.
[pfefferle], sketchess, tantek__ and [cleverdevil] joined the channel
#
[cleverdevil]
Hmm. Interesting. Tag me on the bug on GitHub too please. I may have a chance to take a look at some point.
#
jeremycherfas
Not exactly sure how to do that, so here's the link https://github.com/idno/Known/issues/2097
#
Loqi
[jeremycherfas] #2097 MIME type not attached to photos from Micropub
[jgmac1106], seekr, dosch[m], [grantcodes], wakest, pvagner, plindner, jaduncan[m], zoglesby, sketchess, tantek__, [keithjgrant], [kevinmarks], [chrisaldrich], [miklb], [cjwillcock] and [cleverdevil] joined the channel