<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 17 April 2016 at 17:44, Jean-Baptiste Kempf <span dir="ltr"><<a href="mailto:jb@videolan.org" target="_blank">jb@videolan.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">In what case don't we want it automatic, tbh?<br></blockquote><div><br></div><div>There are several convertors that will reorient your JPEG files according to the orientation tag<br></div><div>*but do not* reset that flag to normal orientation.<br></div><div>If I was given a batch of such converted files, I'd be very glad of an advanced option to<br></div><div>make VLC behave the way it used to.<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>I'm surprised we don't have the right function in vlc_common.h<br></div>
(GetWBE/GetWLE)<br></blockquote><div> </div>I suggest  the patch code is simpler.<br></div><div class="gmail_quote"><div>We have 4 cases: the machine may be storing data big or little endian, <br></div><div>and the JPEG may be storing the EXIF headers as big or little endian.<br><br></div><div>I really don't think the vlc_common functions help because we can't<br></div><div>make any assumptions about the source byte order.<br></div><div><br></div><div>If you think I am wrong, please let me know.<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="h5">
> +    b_autoorient = var_CreateGetBool( p_dec, "jpeg-autoorient" );<br>
<br>
</div></div>var_InheritBool<br>
<div><div></div></div></blockquote><div><br></div><div> Good catch. I was patterning after other code that I guess is <br></div><div>too old, eg line 202 in codec telx.c - written in 2007, which predates<br></div><div>var_InheritBool (from 2010). <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div> </div></div></blockquote>Thank you for your close review. Any errors remain mine of course.<br><br></div><div class="gmail_quote">I am now working through<span name="Rémi Denis-Courmont" class=""> Rémi's excellent (but terse) suggestion.<br><br></span></div><div class="gmail_quote"><span name="Rémi Denis-Courmont" class="">Curiously, I can find no reference to </span>ORIENT_FROM_EXIF<br></div><div class="gmail_quote">And the numbers it returns do not helpfully map to the order of<br></div><div class="gmail_quote">transformations. I'm not sure if I'm expected to use the idea as a<br></div><div class="gmail_quote">template, or whether it should work. If Video and JPEG exif<br></div><div class="gmail_quote">orientation data is supposed to match, then maybe the current code<br></div><div class="gmail_quote">is just wrong. I'm continuing to study it.<br></div><div class="gmail_quote"><br></div></div></div>