Skip to content

Commit

Permalink
Use case-insensitive file extension comparisons for normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
tagavari committed Jul 9, 2022
1 parent 7b83211 commit 7890d9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions AirMessage/Helper/FileNormalizationHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func normalizeFile(url inputFile: URL, ext: String) -> NormalizedFile? {
*/
guard #available(macOS 10.13, *) else { return nil }

if ext == "heic" {
if ext.caseInsensitiveCompare("heic") == .orderedSame {
LogManager.log("Converting file \(inputFile.lastPathComponent) from HEIC", level: .info)

//Get a temporary file
Expand All @@ -54,7 +54,7 @@ func normalizeFile(url inputFile: URL, ext: String) -> NormalizedFile? {
let newFileName = inputFile.deletingPathExtension().lastPathComponent + ".jpeg"

return NormalizedFile(url: tempFile, type: "image/jpeg", name: newFileName)
} else if ext == "caf" {
} else if ext.caseInsensitiveCompare("caf") == .orderedSame {
LogManager.log("Converting file \(inputFile.lastPathComponent) from CAF", level: .info)

//Get a temporary file
Expand Down

0 comments on commit 7890d9b

Please sign in to comment.