<div dir="ltr"><div><div>well, it went fast :-)<br>already ported.<br><br>regarding strictness, i hope just doing that is enough:<br><br>data IfEntry = IfEntry<br>    {<br>        entryTag :: !Word16,<br>        entryFormat :: !Word16,<br>
        entryNoComponents :: !Word32,<br>        entryContents :: !Word32<br>    } deriving Show<br><br></div>Though from past experience, I'm far from sure.<br><br></div>I'll add comments soon and then push it to hackage.<br>
<div><br>emmanuel<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Apr 13, 2014 at 5:08 PM, Emmanuel Touzery <span dir="ltr"><<a href="mailto:etouzery@gmail.com" target="_blank">etouzery@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="">On Sun, Apr 13, 2014 at 4:30 PM, Yitzchak Gale <span dir="ltr"><<a href="mailto:gale@sefer.org" target="_blank">gale@sefer.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Emmanuel Touzery wrote:<br>
>  I could not find a pure haskell library to parse EXIF so I wrote one<br>
> (pretty basic so far):<br>
> <a href="https://github.com/emmanueltouzery/hsexif" target="_blank">https://github.com/emmanueltouzery/hsexif</a><br>
<br>
</div>Very nice! Why not upload it to hackage to make it easier<br>
for others to share and collaborate?<br></blockquote><div><br><br></div></div><div>Yes, that's the plan as soon as I get the basics right and that I write some short documentation. Hopefully very quickly.<br></div><div class="">
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><br>
> I wrote it with binary-strict. I also considered binary, but I would like<br>
> the library not to throw an exception if the file that it's given is not a<br>
> JPEG or is a JPEG without EXIF, but rather return an Either. I didn't manage<br>
> to do that with binary<br>
<br>
</div>Perhaps the function Data.Binary.Get.runGetOrFail is what<br>
you are looking for? Or perhaps the incremental strict interface?<br></blockquote><div><br></div></div><div>Ah yes... Actually I was a bit mislead because I found an haskell wiki stating that with binary it was impossible to catch the exceptions except in the IO monad and I took that at face value. I think runGetOrFail is what I want, I'll test it, thank you!<br>

</div><div class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><br>
>  And then I realized that binary-strict was last updated in 2010, it seems<br>
> cereal is recommended for strict binary file parsing nowadays.<br>
>  So, what should I do? Leave it as it is? Port to cereal? Port to binary?<br>
<br>
</div>The binary-strict library is no longer maintained, since binary now also<br>
provides a strict interface. Both binary and cereal are good choices.<br>
<br>
Probably porting to binary would be easiest if you've already written<br>
it for binary-strict, assuming runGetOrFail or the incremental interface<br>
does what you want.<br></blockquote><div><br></div></div><div>Ok, then I'll try the non-strict binary first then. Most JPG files will be only a couple of megabytes and it wouldn't be THAT bad loading them entirely in memory but then, it seems a bit of a shame. With lazy though I'll have to work a bit on my strictness annotations I think.<br>

<br>Thanks for the hints! Hopefully I can port it to lazy binary and publish it on hackage soon enough...<span class="HOEnZb"><font color="#888888"><br><br>Emmanuel <br></font></span></div></div></div></div>
</blockquote></div><br></div>