Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Batch photo conversion when pic in subfolder  (Read 1668 times)

0 Members and 1 Guest are viewing this topic.

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9272
  • Last login:Today at 06:12:23 am
  • ...
Batch photo conversion when pic in subfolder
« on: November 16, 2010, 07:54:00 pm »
Here's my situation:

My jukebox album art is saved along with the tracks in Album subfolders.  (Music folder/Artist folder/Album folder)
There are two copies.  One is named after the album and the other is just named cover.jpg

They are bitmap files, but they have the jpg extension.  I'm not sure how this happened, my collection has been through a few structure changes for the sake of trying different jukebox software.  The covers were originally attached to the tags, then stripped from them using an option in ThePCJukebox.

Anyways, I have bmp files with jpg extensions that I want to convert to jpegs.  All the programs I've looked at to do them in batches will only work if they are all in one folder. 

Does anyone know of a program that can batch convert pics in different subfolders?

Mario

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 278
  • Last login:March 29, 2021, 08:55:12 pm
  • Mmmmm.....arcades!
    • Mario's Arcade Page
Re: Batch photo conversion when pic in subfolder
« Reply #1 on: November 16, 2010, 11:00:59 pm »
If you have a command line tool to do the conversion, you can do something like this (syntax is probably wrong, but should help you get started). Put this into a .BAT or .CMD file:


@echo off

:: Watch the use of quotes. They are required for folder and
:: file names containing spaces.

:: cd to your music folder
pushd "C:\My Music Folder"

:: loop for all JPG files in all subfolders and call the "convert" subroutine
FOR /f "tokens=*" %%G IN ('dir /b/s *.jpg') do call :convert "%%G"

:: return to starting location
popd

::::::::::::::::::::::::::::::::::::::::::::
:: This is the convert subroutine
:convert

:: cd to the location of the file. This is required for the rename to work.
pushd "%~dp1"

:: rename the JPG file to a BMP file to match the file type
ren "%~nx1" "%~n1.bmp"

:: use whatever convert command you want, and adjust this to the proper syntax.
:: note that you can specify the BMP file as an input, and a JPG file as an output.
"c:\program files\blahblah\convert_command.exe" -input "%~n1.bmp" -output "%~n1.jpg"

:: return to previous location
popd

:: exit subroutine
goto :eof


This site will definitely help: http://ss64.com/nt/


Mario
« Last Edit: November 16, 2010, 11:36:47 pm by Mario »

ptinolv

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 97
  • Last login:January 20, 2024, 01:37:18 am
Re: Batch photo conversion when pic in subfolder
« Reply #2 on: November 17, 2010, 03:18:39 pm »
Try Xnview to process a batch of images. I am not sure how it will work with the fact that the extensions are messed up though. It should work with subfolders.

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9272
  • Last login:Today at 06:12:23 am
  • ...
Re: Batch photo conversion when pic in subfolder
« Reply #3 on: November 17, 2010, 09:01:20 pm »
Try Xnview to process a batch of images. I am not sure how it will work with the fact that the extensions are messed up though. It should work with subfolders.

Thank you. Thank you. Thank you!   :applaud:

That program just saved me an eternity (and only took a minute to figure out how to use).