28 January 2016

NatGeo CNG image converter

Love geography? or you have downloaded their free huge magazine scans library? then you may interested in this tool from http://diplograph.net/posts/decoding_the_complete_national_geographic_images

In short cng2jpg de-obfuscate NatGeo's jpg files (lossless operation).

This is win32 version of C commandline application by Paul Knight, I just change the filemode to make windows version work.

cng2jpg.7z 11Kb

Alternatively .NET GUI application available at https://github.com/keithn/cng2jpg/releases

1 comment:

  1. Here is a Python script to decrypt a whole DVD of the CNG collection. Just change line 4 indicating the drive letter.
    ----------------------------------------------------------
    import os
    from glob import iglob

    rootdir_glob = 'e:/**/*'

    file_list = [f for f in iglob(rootdir_glob, recursive=True) if os.path.isfile(f)]

    for f_in in file_list:
    if f_in.endswith(".cng"):
    f_out = 'c:\\ngm\\' + f_in[3:-3] + 'jpg'
    out_dir = os.path.dirname(f_out)

    if not os.path.exists(out_dir):
    os.makedirs(out_dir)

    with open(f_in, 'rb') as encry, \
    open(f_out, 'wb') as decry:
    decry.write(bytes(x ^ 0xEF for x in encry.read()))
    --------------------------------------------------

    ReplyDelete