diff --git a/README.md b/README.md index 23f2243..97f30fb 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/workflow/rotate-an-image-to-be-oriented-upright.md b/workflow/rotate-an-image-to-be-oriented-upright.md new file mode 100644 index 0000000..1d68ccf --- /dev/null +++ b/workflow/rotate-an-image-to-be-oriented-upright.md @@ -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 `` 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.