# Why did LaTeX rotate my picture?

I inserted a picture in LaTeX, but it rotated my picture. Why?

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\includegraphics[width=0.5\textwidth]{1.jpg}
\end{figure}
\end{document}


All the files are here:files

The meta data of your image contains the tag "orientation" with the value "rotate 90 CW". This value is obeyed by most image viewers, but, as it seems, not LaTeX. Your best approach is probably to rotate that image yourself, as you have found out.

• Interesting. So the keyword of relevance seems to be Exif. Do you know, if there’s a tool, which can correct the orientation, e.g. as a batch run? Apr 13 at 15:53
• Ah, I see it might be the program exiftool exiftool.org , which could be called by Latex via package bashful: tex.stackexchange.com/questions/296767/… Apr 13 at 16:04
• @MS-SPO if you're looking for a tool to batch rotate a lot of images based on exif data, ImageMagick is a very versatile and powerful option: stackoverflow.com/questions/19456036/… Apr 13 at 21:01

It seems to depend on the jpg-File. When I save your foto as png without applying any rotation to it using Paint.net, it seems to be as expected.

\documentclass{article}
\usepackage{graphicx}

\begin{document}
\begin{figure}
\includegraphics[scale=0.05]{1.jpg}
\caption{The jpg-image}
\end{figure}

% --- saving the jpg as png with Paint.net
\begin{figure}
\includegraphics[scale=0.05]{1b}
\caption{The png-image}
\end{figure}
\end{document}


• I try to solve this problem by rotate it: \includegraphics[angle=270,width=\textwidth]. But it is a little trouble. Apr 13 at 15:15