Skip to content

Commit

Permalink
remove old 128
Browse files Browse the repository at this point in the history
Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
  • Loading branch information
marinofaggiana committed Sep 22, 2024
1 parent 12e021d commit 7c8d8fa
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
2 changes: 0 additions & 2 deletions iOSClient/NCGlobal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,10 @@ class NCGlobal: NSObject {
let size1024: CGSize = CGSize(width: 1024, height: 1024)
let size512: CGSize = CGSize(width: 512, height: 512)
let size256: CGSize = CGSize(width: 256, height: 256)
let size128: CGSize = CGSize(width: 128, height: 128)
// Image extension
let previewExt1024 = ".1024.preview.jpg"
let previewExt512 = ".512.preview.jpg"
let previewExt256 = ".256.preview.jpg"
let previewExt128 = ".128.preview.jpg"

func getSizeExtension(column: Int) -> String {
let width = UIScreen.main.bounds.width / CGFloat(column)
Expand Down
2 changes: 1 addition & 1 deletion iOSClient/NCImageCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class NCImageCache: NSObject {
private let utility = NCUtility()
private let global = NCGlobal.shared

private let allowExtensions = [NCGlobal.shared.previewExt256, NCGlobal.shared.previewExt128]
private let allowExtensions = [NCGlobal.shared.previewExt256]
private var brandElementColor: UIColor?

public var countLimit = 10_000
Expand Down
6 changes: 3 additions & 3 deletions iOSClient/Utility/NCUtility+Image.swift
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ extension NCUtility {
}

private func createImageStandard(ocId: String, etag: String, classFile: String, image: UIImage, cost: Int) {
let ext = [global.previewExt512, global.previewExt256, global.previewExt128]
let size = [global.size512, global.size256, global.size128]
let compressionQuality = [0.6, 0.7, 0.8]
let ext = [global.previewExt512, global.previewExt256]
let size = [global.size512, global.size256]
let compressionQuality = [0.6, 0.7]

for i in 0..<ext.count {
if !utilityFileSystem.fileProviderStorageImageExists(ocId, etag: etag, ext: ext[i]),
Expand Down
3 changes: 1 addition & 2 deletions iOSClient/Utility/NCUtilityFileSystem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ class NCUtilityFileSystem: NSObject {
func fileProviderStorageImageExists(_ ocId: String, etag: String) -> Bool {
if fileProviderStorageImageExists(ocId, etag: etag, ext: NCGlobal.shared.previewExt1024),
fileProviderStorageImageExists(ocId, etag: etag, ext: NCGlobal.shared.previewExt512),
fileProviderStorageImageExists(ocId, etag: etag, ext: NCGlobal.shared.previewExt256),
fileProviderStorageImageExists(ocId, etag: etag, ext: NCGlobal.shared.previewExt128) {
fileProviderStorageImageExists(ocId, etag: etag, ext: NCGlobal.shared.previewExt256) {
return true
}
return false
Expand Down

0 comments on commit 7c8d8fa

Please sign in to comment.