The correct mimetype is image/jpeg, not image/jpg. image/jpeg can cause

issues with other platforms. See https://www.rfc-editor.org/rfc/rfc3745
This commit is contained in:
Celso Martinho 2023-01-18 13:13:33 +00:00
parent 3ec9e603df
commit d4fc60b900
1 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
//
// MediaAttachment.swift
//
//
//
// Created by jk234ert on 2/9/21.
//
@ -43,7 +43,7 @@ extension Mastodon.Query.MediaAttachment {
public var mimeType: String {
switch self {
case .jpeg: return "image/jpg"
case .jpeg: return "image/jpeg"
case .gif: return "image/gif"
case .png: return "image/png"
case .other(_, _, let mimeType): return mimeType
@ -53,7 +53,7 @@ extension Mastodon.Query.MediaAttachment {
var base64EncondedString: String? {
return data.map { "data:" + mimeType + ";base64," + $0.base64EncodedString() }
}
public var sizeInByte: Int? {
switch self {
case .jpeg(let data), .gif(let data), .png(let data):