saoudrizwan / Disk

Easily persist structs, images, and data on iOS
MIT License
3.11k stars 172 forks source link

Pass compression quality for jpeg images #83

Open dannydaddy3 opened 5 years ago

dannydaddy3 commented 5 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 5 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