Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: fix invalid jpg extension (Read 454 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

fix invalid jpg extension

This might be old news, but I discovered a utility to add the proper extension to files automatically.
I had quite a few album art downloads that were labeled *.jpg, but are actually *.png .
This utility can fix that:  TrID - File Identifier
I had some trouble doing a batch conversion at first, but I found the trick.
Use "dir /b /s > filename.txt" to create a file with all that you want to check/convert, then do "type myfilelist.txt | trid -ce -@"
(You can use wildcards with the dir command, I looked for "folder.jpg".)
This is helpful if you display album art and it is sometimes not found because of the improper file extension.

BTC:  1EFvqvn51n7qW9yHZHDHPnBZxN17EafUt1

Re: fix invalid jpg extension

Reply #1
Use "dir /b /s > filename.txt" to create a file with all that you want to check/convert, then do "type myfilelist.txt | trid -ce -@"
(You can use wildcards with the dir command, I looked for "folder.jpg".)
It's not necessary to use an intermediate file - the information you linked to already provides the solution:

Quote
TrID can get a file list from stdin, with the -@ switch.
So it's possible to work on an entire folder tree, or a particular subset of files, just using the output of some other command through a pipe. Something like:

Code: [Select]
C:\TrID>dir d:\recovered_drive /s /b | trid -ce -@

I've not tried it, but it would be more conventional to do something like:
Code: [Select]
for /r %g in (<filespec>) do trid -ce %g

/r specifies recurse subfolders; change % to %% if putting this line into a .bat.
It's your privilege to disagree, but that doesn't make you right and me wrong.

 

Re: fix invalid jpg extension

Reply #2
Thanks, just tried the first method you mentioned, works great!
BTC:  1EFvqvn51n7qW9yHZHDHPnBZxN17EafUt1