Closed farnabaz closed 3 years ago
useExifOrientation
option to sharp constructor -> hereoptions.sharp
from IPX to allow customizing this behaviorWe may pass useExifOrientation option to sharp constructor
The sharp constructor does not support this option
There might be a reason this option is disabled by default
I didn't find any downside of enabling this. Event docs does not mention anything about downsides of this option. https://sharp.pixelplumbing.com/api-operation
@pi0 I've added an option to controll metadata removal on modified images
The sharp constructor does not support this option
What about sharp.options.useExifOrientation = true
? 🤔
I didn't find any downside of enabling this. Event docs does not mention anything about downsides of this option.
Feature supported by https://github.com/lovell/sharp/pull/791 (@ncoden <3) At least seems adds additional CalculateExifRotationAndFlip
call (that causes flip, rotate anyway)
There is no enough context about use-case (except one issue for specific project) also about behavior of cloud resizers (like cloudinary). I would suggest keeping it same as sharp defaults unless someone needs option of having better context that for sure we need it.
What about sharp.options.useExifOrientation = true? 🤔
This should work, and calling rotate
with no option is the same. https://github.com/lovell/sharp/blob/master/lib/operation.js#L42
But the idea can be useful, we can support an IPX option to modify Sharp options
Object.assign(sharp.options, ipx.options)
This should work, and calling rotate with no option is the same. https://github.com/lovell/sharp/blob/master/lib/operation.js#L42
I see. Yet i would prefer using explicit option instead of implicitly calling rotate()
for exif
@pi0 What do you think about changes?
This is really cool because users can control default behavior of sharp. What I love most is controling default quality for different formats
We may notice in documentation (both ipx and image module) that changing sharp options, needs a manual cache revalidation (or automate by generating cahce/integerity file with a checksum of options and invalidate directory if mistmatched)
I suggest to add docs and we can implement automation logic later
Use
rotate
operation to auto-rotate image based on EXIF orientation TAG.Docs of rotate operation: https://github.com/lovell/sharp/blob/0ee08bfe46e0b204b34151fead8139027c768375/lib/operation.js#L41
fix https://github.com/nuxt/image/issues/70