saoudrizwan / Disk

Delightful framework for iOS to easily persist structs, images, and data
MIT License
3.08k stars 171 forks source link

Pass compression quality for jpeg images #83

Open dannydaddy3 opened 4 years ago

dannydaddy3 commented 4 years ago

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

dannydaddy3 commented 4 years ago

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