{"id":217,"date":"2004-02-18T02:05:11","date_gmt":"2004-02-18T07:05:11","guid":{"rendered":"http:\/\/www.flamingspork.com\/blog\/?p=217"},"modified":"2013-10-04T09:26:22","modified_gmt":"2013-10-03T23:26:22","slug":"jpeg_recoverc","status":"publish","type":"post","link":"https:\/\/www.flamingspork.com\/blog\/2004\/02\/18\/jpeg_recoverc\/","title":{"rendered":"jpeg_recover.c"},"content":{"rendered":"<p>New junkcode addition &#8211; jpeg_recover.c<br \/>\n<a href=\"https:\/\/www.flamingspork.com\/junkcode\/\">http:\/\/www.flamingspork.com\/junkcode\/<\/a><\/p>\n<p>Borne out of weirdness going wrong with a friend&#8217;s compact flash card while we were on holiday &#8211; suddenly a bunch of photos went missing. It didn&#8217;t seem to be easy to recover them using conventional manipulations of the FAT filesystem, so instead (without an internet connection, but with lots of beer) hacked up a program that searches through a file (given as the command line parameter) extracts things that look like jpeg files and dumps them in the current directory. It can produce a number of false-positives, which is probably due to the fact that I didn&#8217;t have access to any jpeg specs, so this is all from looking at some jpeg files and working out something simple, quickly. But hey, we got a fair few of the photos back.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>New junkcode addition &#8211; jpeg_recover.c http:\/\/www.flamingspork.com\/junkcode\/ Borne out of weirdness going wrong with a friend&#8217;s compact flash card while we were on holiday &#8211; suddenly a bunch of photos went missing. It didn&#8217;t seem to be easy to recover them &hellip; <a href=\"https:\/\/www.flamingspork.com\/blog\/2004\/02\/18\/jpeg_recoverc\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[9],"tags":[],"class_list":["post-217","post","type-post","status-publish","format-standard","hentry","category-website"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5a6n8-3v","jetpack-related-posts":[{"id":190,"url":"https:\/\/www.flamingspork.com\/blog\/2003\/11\/18\/junkcode-updates\/","url_meta":{"origin":217,"position":0},"title":"Junkcode updates","author":"Stewart Smith","date":"2003-11-18","format":false,"excerpt":"New stuff on junkcode including my LaTeX word counter, scripts to help in Tru64 to FreeBSD migration and PINE to Maildir stuff.","rel":"","context":"In &quot;website&quot;","block_context":{"text":"website","link":"https:\/\/www.flamingspork.com\/blog\/category\/website\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2289,"url":"https:\/\/www.flamingspork.com\/blog\/2011\/02\/08\/timing-queries-in-the-21st-century-with-ld_preload-and-sed\/","url_meta":{"origin":217,"position":1},"title":"Timing queries in the 21st century (with LD_PRELOAD and sed)","author":"Stewart Smith","date":"2011-02-08","format":false,"excerpt":"So... Baron blogged about wanting higher precision timers from the mysql binary and that running sed on the binary wasn't cutting it. However... I am not one to give up that easily! This is what LD_PRELOAD was made for! Evil nasty hacks to make your life easier! By looking at\u2026","rel":"","context":"In &quot;code&quot;","block_context":{"text":"code","link":"https:\/\/www.flamingspork.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":88,"url":"https:\/\/www.flamingspork.com\/blog\/2003\/04\/21\/updated\/","url_meta":{"origin":217,"position":2},"title":"updated&#8230;","author":"Stewart Smith","date":"2003-04-21","format":false,"excerpt":"Added my \"MacOS X as UNIX\" talk to the talks page, the linked list code to the junkcode page and generally thinking about actually putting up all that old stuff i've got lying around on my .mac account. Which reminds me, i should really start migrating everything over to flamingspork.com.....","rel":"","context":"In &quot;website&quot;","block_context":{"text":"website","link":"https:\/\/www.flamingspork.com\/blog\/category\/website\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":397,"url":"https:\/\/www.flamingspork.com\/blog\/2005\/04\/19\/andre-pang-on-csv-to-address-book\/","url_meta":{"origin":217,"position":3},"title":"Andre Pang on CSV to Address Book","author":"Stewart Smith","date":"2005-04-19","format":false,"excerpt":"%u039Blgorithm.com.au: CSV to Address Book Importer Surely my OSX Address book VCF to Evo VCF perl script is more free software friendly. i think tihs may even be fixed now. i seem to recall a bugzilla mail recently. so maybe it's redundant! yay! move from the proprietry world of OSX\u2026","rel":"","context":"In &quot;life, the universe and everything&quot;","block_context":{"text":"life, the universe and everything","link":"https:\/\/www.flamingspork.com\/blog\/category\/life-the-universe-and-everything\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":720,"url":"https:\/\/www.flamingspork.com\/blog\/2006\/06\/30\/mysql-bug-deskbar-plugin\/","url_meta":{"origin":217,"position":4},"title":"MySQL Bug Deskbar plugin","author":"Stewart Smith","date":"2006-06-30","format":false,"excerpt":"Over at my junkcode section, I have mysqlbug.py which is a plugin for the GNOME deskbar panel applet. If you've used Quicksilver on MacOSX, then you know the kind of app that Deskbar Applet is. This one lets you type \"bug 1234\" and be given the action of \"open mysql\u2026","rel":"","context":"In &quot;General&quot;","block_context":{"text":"General","link":"https:\/\/www.flamingspork.com\/blog\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":391,"url":"https:\/\/www.flamingspork.com\/blog\/2005\/04\/14\/binstat\/","url_meta":{"origin":217,"position":5},"title":"~\/bin\/stat","author":"Stewart Smith","date":"2005-04-14","format":false,"excerpt":"What have you always wanted on the command line? stat? i: hear; you cry! (insert more [silly] {punctuation} around 'ere!) I present, to you, my ~\/bin\/stat #!\/usr\/bin\/perl use POSIX qw(strftime); my $FORMAT=\"%H:%M %a, %e %b %y\"; foreach(@ARGV) { my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, $atime,$mtime,$ctime,$blksize,$blocks) = stat($_); print $_.\"\\n\"; print \"Dev: $dev\\n\"; print \"inode:\u2026","rel":"","context":"In &quot;General&quot;","block_context":{"text":"General","link":"https:\/\/www.flamingspork.com\/blog\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/217","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/comments?post=217"}],"version-history":[{"count":2,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/217\/revisions"}],"predecessor-version":[{"id":3443,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/217\/revisions\/3443"}],"wp:attachment":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/media?parent=217"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/categories?post=217"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/tags?post=217"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}