saoudrizwan / Disk

Delightful framework for iOS to easily persist structs, images, and data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pass compression quality for jpeg images

dannydaddy3 opened this issue · comments

It would be good to have an ability to pass quality parameter when saving jpeg images.

Or probably global variable like:
Disk.jpegCompressionQuality = 0.95

This would save half of disk space

func save(_ value: UIImage, to directory: Directory, as path: String, jpegQuality: CGFloat = 1.0)

This option would be better actually, because you may save two images at the same time and need different jpeg quality for each of them. I have such use case in my project