Swime icon indicating copy to clipboard operation
Swime copied to clipboard

Determine extension from String/URL

Open Idomo opened this issue 6 years ago • 2 comments

Hi, First of all, thanks for this great helper!

I thought that if there is already a list of extensions, maybe an option to get a MimeType from String/NSString/URL/NSURL won’t be that hard-to-add functionality and I think it would be an great addition to this helper.

Hope you’ll be able to add this soon, Ido.

Idomo avatar Aug 23 '19 17:08 Idomo

@Idomo hi thanks for the kind words! So you're saying String means getting mime type from a base64 string right, and for URL the code will fetch first few bytes then determine the mime type based on those bytes? If yes: I think this functionality is better to be implemented in a different repo, the reason is to keep the package small enough so people are free to choose whether to include the "extension" package or not.

sendyhalim avatar Aug 25 '19 17:08 sendyhalim

No, I think you’ve misunderstood me, I didn’t mentioned to use bytes at all, only from the String itself, the chars from the end of it (after the dot).

‫ב-25 באוג׳ 2019, בשעה 20:15, ‏‏Sendy Halim ‏[email protected] כתב/ה:‬

@Idomo hi thanks for the kind words! So you're saying String means getting mime type from a base64 string right, and for URL the code will fetch first few bytes then determine the mime type based on those bytes? If yes: I think this functionality is better to be implemented in a different repo, the reason is to keep the package small enough so people are free to choose whether to include the "extension" package or not.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

Idomo avatar Aug 25 '19 18:08 Idomo