It is currently 19 Apr 2024, 04:06
   
Text Size

script to use card images from Pictures torrent with Forge

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

script to use card images from Pictures torrent with Forge

Postby briala » 29 Apr 2016, 17:55

I'm new to Forge, so didn't have any HQ card images on my computer, and they are no longer downloadable from within the program.

The FAQ here links to a Pictures torrent that has all the images, but they are not organized per the structure / filenames / directory names that Forge requires.

I wrote this quick and dirty script to handle the necessary conversions. It extracts only the English language cards. Run it from within the Pictures directory, and move the contents of the resulting "cards" directory to your Forge card images directory.

It is destructive, so make a copy beforehand if you want to use those images for other purposes or otherwise want to be safe.

It worked for me, but this is not release quality code, I offer no support, and you should probably only use this if it's the kind of thing you'd feel comfortable making yourself but just want to benefit from my having typed it out for you.

I am new to Forge and have no idea if there was a better/easier way to do this (you'd think there would be, but maybe it was moot for all the time the image server was up.)

Code: Select all
#!/bin/bash

# for Pictures archive as of April 22, 2016 (up through Magic Origins/Oath of the Gatewatch)

# TODO: Version that generates Forge-style while maintaining archive as is.
# TODO: Languages other than ENG
# TODO: Don't spam harmless errors.

mkdir -p cards

mv "Core Sets/1st Limited Edition Alpha" cards/A
mv "Core Sets/1st Limited Edition Beta" cards/B
mv "Core Sets/2nd Unlimited" cards/U
mv "Core Sets/3rd Revised Edition" cards/R
mv "Core Sets/4th Edition" cards/4E
mv "Core Sets/5th Edition" cards/5E
mv "Core Sets/6th Classic Edition" cards/6E
mv "Core Sets/7th Edition" cards/7E
mv "Core Sets/8th Edition" cards/8E
mv "Core Sets/9th Edition" cards/9E
mv "Core Sets/10th Edition" cards/10E
mv "Core Sets/Magic 2010" cards/M10
mv "Core Sets/Magic 2011" cards/M11
mv "Core Sets/Magic 2012" cards/M12
mv "Core Sets/Magic 2013" cards/M13
mv "Core Sets/Magic 2014" cards/M14
mv "Core Sets/Magic 2015" cards/M15
mv "Core Sets/Magic Origins" cards/ORI

mv "Expansions/Arabian Nights" cards/AN
mv "Expansions/Antiquities" cards/AQ
mv "Expansions/Legends" cards/LG
mv "Expansions/The Dark" cards/DK
mv "Expansions/Fallen Empires" cards/FE
mv "Expansions/Homelands" cards/HL
mv "Expansions/Ice Age" cards/IA
mv "Expansions/Alliances" cards/AL
mv "Expansions/Coldsnap" cards/CS
mv "Expansions/Mirage" cards/MI
mv "Expansions/Visions" cards/VI
mv "Expansions/Weatherlight" cards/WL
mv "Expansions/Tempest" cards/TE
mv "Expansions/Stronghold" cards/SH
mv "Expansions/Exodus" cards/EX
mv "Expansions/Urza's Saga" cards/US
mv "Expansions/Urza's Legacy" cards/UL
mv "Expansions/Urza's Destiny" cards/UD
mv "Expansions/Mercadian Masques" cards/MM
mv "Expansions/Nemesis" cards/NE
mv "Expansions/Prophecy" cards/PY
mv "Expansions/Invasion" cards/IN
mv "Expansions/Planeshift" cards/PS
mv "Expansions/Apocalypse" cards/AP
mv "Expansions/Odyssey" cards/OD
mv "Expansions/Torment" cards/TO
mv "Expansions/Judgment" cards/JU
mv "Expansions/Onslaught" cards/ON
mv "Expansions/Legions" cards/LE
mv "Expansions/Scourge" cards/SC
mv "Expansions/Mirrodin" cards/MR
mv "Expansions/Darksteel" cards/DS
mv "Expansions/Fifth Dawn" cards/FD
mv "Expansions/Champions of Kamigawa" cards/CHK
mv "Expansions/Betrayers of Kamigawa" cards/BOK
mv "Expansions/Saviors of Kamigawa" cards/SOK
mv "Expansions/Ravnica City of Guilds" cards/RAV
mv "Expansions/Guildpact" cards/GP
mv "Expansions/Dissension" cards/DIS
mv "Expansions/Time Spiral" cards/TSP
mv "Expansions/Time Spiral Timeshifted" cards/TSB
mv "Expansions/Planar Chaos" cards/PLC
mv "Expansions/Future Sight" cards/FUT
mv "Expansions/Lorwyn" cards/LRW
mv "Expansions/Morningtide" cards/MOR
mv "Expansions/Shadowmoor" cards/SHM
mv "Expansions/Eventide" cards/EVE
mv "Expansions/Shards of Alara" cards/ALA
mv "Expansions/Conflux" cards/CON
mv "Expansions/Alara Reborn" cards/ARB
mv "Expansions/Zendikar" cards/ZEN
mv "Expansions/Worldwake" cards/WWK
mv "Expansions/Rise of the Eldrazi" cards/ROE
mv "Expansions/Scars of Mirrodin" cards/SOM
mv "Expansions/Mirrodin Besieged" cards/MBS
mv "Expansions/New Phyrexia" cards/NPH
mv "Expansions/Innistrad" cards/ISD
mv "Expansions/Dark Ascension" cards/DKA
mv "Expansions/Avacyn Restored" cards/AVR
mv "Expansions/Return to Ravnica" cards/RTR
mv "Expansions/Gatecrash" cards/GTC
mv "Expansions/Dragon's Maze" cards/DGM
mv "Expansions/Theros" cards/THS
mv "Expansions/Born of the Gods" cards/BNG
mv "Expansions/Journey into Nyx" cards/JOU
mv "Expansions/Khans of Tarkir" cards/KTK
mv "Expansions/Fate Reforged" cards/FRF
mv "Expansions/Dragons of Tarkir" cards/DTK
mv "Expansions/Battle for Zendikar" cards/BFZ
mv "Expansions/Oath of the Gatewatch" cards/OGW

SETS=cards/*
for s in $SETS
do
   if [ -f "$s/ENG TOK.zip" ]; then
      mkdir "$s Tokens"
      mv "$s/ENG TOK.zip" "$s Tokens/ENG.zip"
   fi
done

SETS=cards/*
for s in $SETS
do
   cd $s
   unzip ENG.zip
   
   rename .jpg .full.jpg *.jpg
   rename " [1]" 1 *.jpg
   rename " [2]" 2 *.jpg
   rename " [3]" 3 *.jpg
   rename " [4]" 4 *.jpg   
   rename " [1a]" 1a *.jpg
   rename " [2a]" 2a *.jpg
   rename " [3a]" 3a *.jpg
   rename " [4a]" 4a *.jpg      
   
   rm *.zip
   
   cd ..
done
Edit: It turns out Forge expects two letter set codes for sets before 10E, and one letter for the original 4. Fixed.
briala
 
Posts: 2
Joined: 20 Apr 2016, 22:12
Has thanked: 3 times
Been thanked: 0 time

Return to Forge

Who is online

Users browsing this forum: No registered users and 80 guests


Who is online

In total there are 80 users online :: 0 registered, 0 hidden and 80 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 80 guests

Login Form