How Can I Convert Ngm Files?

Discussion in 'Software' started by Glen62, Mar 30, 2018.

  1. Glen62

    Glen62 Private E-2

    I recently bought a National Geographic magazine disc set at a thrift store. This is a six disc set that has very magazine from 1888 to 2009. I tried it on my computer and discovered that it wont show the pics on Windows Media or Realplayer or anything that my computer has because the images are NGM files. I understand that there is software to convert those files, but I don't what software to go with. Can anyone help me with that? Thanks.
     
  2. TimW

    TimW MajorGeeks Administrator - Jedi Malware Expert Staff Member

    What is the actual file path?
     
  3. Eldon

    Eldon Major Geek Extraordinaire

    The file extension .ngm is not listed by FileInfo, File-Extensions.org or Wikipedia.
    It's either a propriety format owned by National Geographic Magazine or (hopefully) a regular format with a different extension.
    If you can copy one of the files, put it in a zip archive and upload it.
     
  4. Glen62

    Glen62 Private E-2

    Thanks Tim W and Eldon. I'm an absolute dummy with this, but the individual images that are listed are NGM, but the properties of each file say CNG. Looks like National Geographic went with some very rare file formats destined (or was it DESIGNED) to become obsolete. What the hell were they thinking?
     
    Last edited: Mar 31, 2018
  5. GermanOne

    GermanOne Guest

    I found several sites in the internet that state .cng files are .jpg files where every byte was XORed with 0xEF. Actually something that could be done with a little script. But since people like graphical user interfaces I tried to find something the like. Unfortunately MG doesn't seem to have such a converter listed. But I found a lightweight tool on GitHub.
    https://github.com/keithn/cng2jpg/releases
    I had a look at the C# source code and found it'll do exactly the bitwise operation described above.
    That's the VirusTotal scan result:
    https://www.virustotal.com/#/file/4...54f5f32d9d3bbfc0fc6db0b09c94a94d054/detection
    I wasn't able to test the program because I didn't find any .cng examples for trials. So be careful. Maybe try with some backed up files first.

    Steffen
     
  6. Glen62

    Glen62 Private E-2

    Thanks, GermanOne, I'll give that a try.
     
  7. Eldon

    Eldon Major Geek Extraordinaire

  8. GermanOne

    GermanOne Guest

    Since somebody gave me a certain title I feel I have to live up to expectations :D
    Here's the VBScript code, but you can just download the attached ZIP file.

    cng2jpg.vbs
    Code:
    Option Explicit
    Dim ShFolder, Wsh, Fso, FsFile, StreamIn, StreamOut, Arr(), i
    Const BIF_RETURNONLYFSDIRS = &h00000001&, BIF_NONEWFOLDERBUTTON = &h00000200&, ssfDRIVES = &h11&, ForWriting = 2, MB_TOPMOST = &h00040000&
    
    Set ShFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Select the directory containing the .cng files . . .", BIF_RETURNONLYFSDIRS Or BIF_NONEWFOLDERBUTTON, ssfDRIVES)
    If ShFolder Is Nothing Then WScript.Quit
    
    Set Wsh = CreateObject("WScript.Shell")
    Wsh.Popup "You'll get informed as soon as the conversion has been finished.", 3, "This may take awhile . . .", vbSystemModal
    
    Set Fso = CreateObject("Scripting.FileSystemObject")
    For Each FsFile In Fso.GetFolder(ShFolder.Self.Path).Files
      If LCase(Fso.GetExtensionName(FsFile.Name)) = "cng" Then
        ReDim Arr(FsFile.Size)
    
        Set StreamIn = FsFile.OpenAsTextStream
        For i = 0 To FsFile.Size - 1
          Arr(i) = Chr(Asc(StreamIn.Read(1)) Xor &hEF)
        Next
        StreamIn.Close
    
        Set StreamOut = Fso.OpenTextFile(Left(FsFile.Path, Len(FsFile.Path) - 3) & "jpg", ForWriting, True)
        StreamOut.Write Join(Arr, "")
        StreamOut.Close
      End If
    Next
    
    Wsh.Popup "All .cng files in" & vbLf & """" & ShFolder.Self.Path & """" & vbLf & "converted.", 0, "Done", vbInformation Or vbSystemModal Or MB_TOPMOST
    
    If you run the script then the first thing that comes up is a Browse For Folder dialog where you have to choose the folder that contains your .cng files. Then a popup tells you that the script starts to convert the file. The conversion will take quite awhile where you don't see any window. Be patient and just carry on with other things you want to do on your computer. You'll get another popup as soon as the script has been finished.
    Note that it won't work on the magazine disk. The script needs to write the converted files in the same directory along with your .cng files. Thus, copy the folders to another drive beforehand.

    Steffen
     

    Attached Files:

    Eldon likes this.

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds