mirror of
https://github.com/jbranchaud/til
synced 2026-01-05 08:08:02 +00:00
Add Rotate An Image To Be Oriented Upright as a workflow til
This commit is contained in:
@@ -9,7 +9,7 @@ and pairing with smart people at Hashrocket.
|
||||
|
||||
For a steady stream of TILs, [sign up for my newsletter](https://tinyletter.com/jbranchaud).
|
||||
|
||||
_893 TILs and counting..._
|
||||
_894 TILs and counting..._
|
||||
|
||||
---
|
||||
|
||||
@@ -1016,6 +1016,7 @@ _893 TILs and counting..._
|
||||
- [Import A Github Project Into CodeSandbox](workflow/import-a-github-project-into-codesandbox.md)
|
||||
- [Interactively Kill A Process With fkill](workflow/interactively-kill-a-process-with-fkill.md)
|
||||
- [Open Slack's Keyboard Shortcuts Reference Panel](workflow/open-slacks-keyboard-shortcuts-reference-panel.md)
|
||||
- [Rotate An Image To Be Oriented Upright](workflow/rotate-an-image-to-be-oriented-upright.md)
|
||||
- [Set Recurring Reminders In Slack](workflow/set-recurring-reminders-in-slack.md)
|
||||
- [Toggle Between Stories In Storybook](workflow/toggle-between-stories-in-storybook.md)
|
||||
|
||||
|
||||
27
workflow/rotate-an-image-to-be-oriented-upright.md
Normal file
27
workflow/rotate-an-image-to-be-oriented-upright.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# Rotate An Image To Be Oriented Upright
|
||||
|
||||
Many programs that display JPEG images will read the EXIF data for
|
||||
'Orientation' headers so that they can correctly display the image. Not all of
|
||||
them though. For instance, when a browser renders an `<img>` tag for such a
|
||||
JPEG image, it won't account for the 'Orientation' header and you might end up
|
||||
with a sideways image.
|
||||
|
||||
You can normalize the orientation with the
|
||||
[`jhead`](https://www.sentex.ca/~mwandel/jhead/usage.html) utility which uses
|
||||
[`jpegtran`](https://linux.die.net/man/1/jpegtran) under the hood. This is done
|
||||
with the `-autorot` flag.
|
||||
|
||||
```bash
|
||||
$ jhead -autorot my_image.jpeg
|
||||
```
|
||||
|
||||
> Using the 'Orientation' tag of the Exif header, rotate the image so that it
|
||||
> is upright. The program 'jpegtran' is used to perform the rotation. After
|
||||
> rotation, the orientation tag of the Exif header is set to '1' (normal
|
||||
> orientation). The Exif thumbnail is also rotated.
|
||||
|
||||
> This feature is especially useful with newer digital cameras [and
|
||||
> smartphones], which set the orientation field in the Exif header
|
||||
> automatically using a built in orientation sensor in the camera.
|
||||
|
||||
The image will now be upright in all programs.
|
||||
Reference in New Issue
Block a user