proximity-engine / proximity Goto Github PK
View Code? Open in Web Editor NEWA tool to assemble Magic: The Gathering proxies from a set of template images
A tool to assemble Magic: The Gathering proxies from a set of template images
While thinking about a new template design thats very unique. I thought about maybe having the ability to have the non flattened image. A complete workable editable card but in all its layers. This makes troubleshooting things so much more simple. Also helps build new card designs and know how it will turn out before the frame is built.
Good evening! When I run this using the latest JDK (20.0.1), it gives me "...only recognizes class versions up to 55.0"
What am I doing wrong in the command prompt?
Should be able to control almost any attributes of a layer, including Style
s, layer x
and y
values. Pretty much the only thing that should be unaffected is the layers id.
Supersedes #11
Wiki getting started instructions mention creating a templates
directory, but it looks like both that and a templates_overrides
directory are required as there's an explicit load of it here.
The exception message thrown doesn't mention the path it was trying, so it's a bit hard to diagnose what the issue is.
It would be nice to be able to override the default flavor text with custom text.
First of all I love all the work you've put into this tool.
Now I was wondering if there is a way to trick the tool to use the artifact frame for colorless cards, like Devoid cards?
Cause right now it returns a transparent frame, while still using the crop art rather than the full art.
I just ran Proximity for the first time and got the following error.
Here is my card list
https://gist.github.com/jessegavin/307b8f2128742a8785b790a4a92fb5d1
My directory structure looks like this.
I ran the following command.
java -jar proximity-0.6.2.jar --cards=card-list.txt --template=M15-Master-Template-1.0.9.zip
539 images were generated in images/backs
537 images were generated in images/fronts
I got the following error.
INFO [Proximity] 1074/1080 3841ms Young Pyromancer SAVED
INFO [Proximity] 1075/1080 3435ms Zealous Conscripts SAVED
INFO [Proximity] 1076/1080 394574ms Gilded Drake SAVED
ERROR [Proximity] 1076/1080 42104ms Voltaic Visionary FAILED
ERROR [Proximity] 1076/1080 77055ms Tovolar's Huntmaster FAILED
ERROR [Proximity] 1076/1080 234322ms Olivia, Crimson Bride FAILED
ERROR [Proximity] javax.imageio.IIOException: Can't create cache file!
ERROR [Proximity] javax.imageio.IIOException: Can't create cache file!
ERROR [Proximity] java.nio.file.FileSystemException: .cache/nc3nv0r9a3h3ybnyhng84i1v48gzoliq: Too many open files
ERROR [Proximity] Error rendering cards:
Error(s) rendering cards:
Error rendering children for layer :
Error(s) rendering children for layer :
Error(s) rendering children for layer overlays:
Error(s) rendering children for layer overlays.loyalty:
Element 'loyalty' is null.
Did I just run out of memory?
Adding the ability to take a optional folder path would be great for the UI portion as of now I have to do the full file path for the text file and template folder and this can lead to more errors than I'd like. Making it optional means people using the cli would not be affected and would hopefully mean minor code changes? I don't know Java but if this is too much work I can see what I can do to get it done.
This will be especially useful for displaying options when there is a UI available.
Currently Proximity is saving the PNG in RGBA with no or very little compression. The Alpha is needed for people making frames to then edit later but for many use cases it would be nice to have the option to drop the alpha layer as an option.
This is some example file sizes:
Lightning Bolt - base M15 template
10.8 MB - PNG - Fresh from Proximity with Alpha layers. RGBA
6.99 MB - PNG - Just optimized the Proximity image keeping the alpha layer
6.20 MB - PNG, no alpha, max compression
I did this compression using Pillow in Python and had basically the same numbers from Photoshop saving the file.
When trying out set SVG set symbols from CCGHQ forums (https://www.slightlymagic.net/forum/viewtopic.php?f=15&t=7010) I encountered an NPE during processing (SVGLayerRendered.java, line 53). This is due to SVG files missing viewbox attribute in the svg element, only width/height attributes are present as seen in the sample: R.svg.txt.
Current code for this looks like this:
SVGRect svgBounds = root.getViewBox().getBaseVal();
double svgWidth = svgBounds.getWidth(), svgHeight = svgBounds.getHeight();
Unfortunately the batik API doesn't have a simple way of checking if the viewbox attribute is available, so a simple workaround I'm using right now uses this:
double svgWidth, svgHeight;
SVGRect svgBounds = root.getViewBox().getBaseVal();
try {
svgWidth = svgBounds.getWidth();
svgHeight = svgBounds.getHeight();
}
catch (Exception ex) {
svgWidth = root.getWidth().getBaseVal().getValue();
svgHeight = root.getHeight().getBaseVal().getValue();
svgBounds.setX(0);
svgBounds.setY(0);
svgBounds.setWidth((float)svgWidth);
svgBounds.setHeight((float)svgHeight);
}
But I suppose it can be made even better...
Really minor issue, but the render for the backside of transforming double-faced cards is missing the colored circle by the typeline that indicates the card's color. See Avacyn the Purifier as an example. Also, the backside of TDFCs include the front side's power/toughness, which is wrong. Only the front of a TDFC includes reminder power/toughness for the back. Not the other way around.
Basically move the entirety of the Symbol helper class to a class that parses all of that information out of each template.
More specifically, allow end users to disable layers with an option without having to open the template or having to modify the template itself.
having a little issue with the cards Black Market Connections and Dawnbringer Cleric
seems there is some bad synergy when having bullet and italics/dash
testing the issue I overloaded the oracle and can remove bullet or i can remove dash and it works but cannot have both together like that for some reason
Doesn't render lands like Ancient Tomb or Volrath's Stronghold. Editing line 118 of the XML and changing the value to "true" fixed it for me.
When using --border= it doesnt matter which value you pick the border is still there and black.
Prismatic Vista and Fabled Passage at least have the grey-brown color while they should be golden. Any colors land are okay though.
Both versions of java I have installed on my machine (OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.9.1+1)
and Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
) were built in 2020 and yet neither of them is even close to being able to run the jars built on the release page. I bet most other people's versions of Java are even older.
When I try and run it, I get this:
Error: LinkageError occurred while loading main class dev.hephaestus.proximity.Main
java.lang.UnsupportedClassVersionError: dev/hephaestus/proximity/Main has been compiled by a more recent version of the Java Runtime (class file version 60.0), this version of the Java Runtime only recognizes class file versions up to 55.0
With the following decklist and --use_official_art=true on the command line
Expected result:
1 - MTGPics Toralf, God of Fury on the front, MTGPics Toralf's Hammer on the back
2 - Scryfall scan Toralf, God of Fury on the front, MTGPics Toralf's Hammer on the back
3 - MTGPics Toralf, God of Fury on the front, Scryfall scan Toralf's Hammer on the back
Actual result:
1 - MTGPics Toralf, God of Fury on the front, MTGPics Toralf, God of Fury on the back
2 - Scryfall scan Toralf, God of Fury on the front, MTGPics Toralf's Hammer on the back
3 - MTGPics Toralf, God of Fury on the front, MTGPics Toralf, God of Fury on the back
Cards do not have set symbols. I'm sure this is in the works, but figured I would log it as an enhancement request so it can be tracked.
Would be nice to create an option to use the original set symbol or a custom one, something like --set_symbol=printed, --set_symbol=custom.png, --set_symbol=none, something to that effect. I know a lot of people who make cubes and custom sets like to have custom set symbols.
using version 0.5.2
getting an error using long dash in type_line override
the below type line was copied from scryfall and the word Creature removed but throws error due to an issue with the long dash
Ertai, the Corrupted --override=type_line:"Legendary โ Phyrexian Human Wizard"
java.nio.charset.MalformedInputException: Input length = 1
at java.base/java.nio.charset.CoderResult.throwException(CoderResult.java:274)
at java.base/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
at java.base/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:188)
at java.base/java.io.InputStreamReader.read(InputStreamReader.java:177)
at java.base/java.io.BufferedReader.fill(BufferedReader.java:162)
at java.base/java.io.BufferedReader.readLine(BufferedReader.java:329)
at java.base/java.io.BufferedReader.readLine(BufferedReader.java:396)
at dev.hephaestus.proximity.Main.loadCardsFromFile(Main.java:74)
at dev.hephaestus.proximity.Main.lambda$main$2(Main.java:57)
at dev.hephaestus.proximity.util.Result.then(Result.java:45)
at dev.hephaestus.proximity.Main.main(Main.java:56)
Hello @Haven-King !
I've made a Mardown page to explain how to use the myojin223 Ready to Use Proximity.
I can't make a PR for the Wiki page, so I made an Issue here :)
It would be great to have a log of what the program did, sometimes it goes so quick I can't even see what was printed to the log. Might be best as another flag you can add to the command
Hi, first of all thanks for the repo, super cool.
I was testing version 0.4.0 a couple of weeks ago and I had no problem whatsoever. However, moving to 0.5.x, I get the following stack:
INFO [Proximity] Fetching info for 1 cards...
1/1
INFO [Proximity] Successfully found 1 cards. Took 512ms
INFO [Proximity] Rendering 1 cards on 1 threads
ERROR [Proximity] 0/1 41ms Sword of Feast and Famine FAILED
ERROR [Proximity] Cannot invoke "java.nio.file.Path.getFileSystem()" because "path" is null
DEBUG [Proximity] java.base/java.nio.file.Files.provider(Files.java:105)
DEBUG [Proximity] java.base/java.nio.file.Files.isDirectory(Files.java:2316)
DEBUG [Proximity] dev.hephaestus.proximity.Proximity.save(Proximity.java:458)
DEBUG [Proximity] dev.hephaestus.proximity.Proximity.render(Proximity.java:440)
DEBUG [Proximity] dev.hephaestus.proximity.Proximity.renderAndSave(Proximity.java:397)
DEBUG [Proximity] dev.hephaestus.proximity.util.Result.then(Result.java:45)
DEBUG [Proximity] dev.hephaestus.proximity.Proximity.run(Proximity.java:87)
DEBUG [Proximity] dev.hephaestus.proximity.util.Result.ifPresent(Result.java:66)
DEBUG [Proximity] dev.hephaestus.proximity.Main.main(Main.java:60)
INFO [Proximity] Done! Took 563ms
I am running java -jar proximity-0.5.2.jar --cards=card_list.txt --template=chillis.zip
from a docker image based on openjdk:16
(openjdk:17
works all the same). Build 0.4.0 still works fine, though.
Any idea where this might be coming from?
Thanks!
Not sure what is causing it to fail as the only error that spits out is index 38, length 38.
To re-create issue, download latest ver and add 1x Breeding Pool to text file or use one of your test text that has it. The one with the following will start with breeding pool and fail then it will download 3 of the 5, giving no fail or saved message for Rhox Bodyguard.
1x Elbrus, the Binding Blade // Withengar Unbound
1x Breeding Pool
1x Rhox Bodyguard
1x Sovereigns of Lost Alara
1x Slippery Bogle
This is a great project but I feel the README, the wiki, and error messages need some improvements to explain basic things.
Island
-> error, 1x Island
-> okay, 1x Storm Crow
-> error,--template=[...].zip
but there is neither a zip nor the explanation what needs to be in it / how to create it. Also, the option to use folders is missing in the wiki.Would be useful for watermarks, set symbols, etc.
Just having a small issue with 0.5.2 with any cards that have a dash in the card name, the dash is not included in the file name. For example Snow-Covered Forest
I've been trying to add some simple docker support for running Proximity. It works currently, but with all the flags you pass, the command line becomes kinda bogged down.
It'd be very neat to be able to simply mount a properties file together with the cards file and the template zip file. Then have the program infer settings from either the properties file or from the command line flags (with flags probably taking precedence)
Currently, you have the ability to enter an override for oracle text, however it does not respect the new line character (\n). We should allow that to work in the overrides, which makes it such that we can create our own oracle text.
For example:
1 Damn (MH2) --override=oracle_text:"Destroys target creature without the possibility of regeneration.\nOverload {2}{W}{W} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")"
running jdk 17.0.1 and proximity 0.4.0 is working
but proximity 0.5.0 and 0.5.1 not working, getting below messages:
WARNING: A terminally deprecated method in java.lang.System has been called
WARNING: System::setSecurityManager has been called by dev.hephaestus.proximity.Main
WARNING: Please consider reporting this to the maintainers of dev.hephaestus.proximity.Main
WARNING: System::setSecurityManager will be removed in a future release
ERROR [Proximity] Cannot invoke "java.nio.file.Path.getFileSystem()" because "path" is null
Making it able to search for cards even if the capital letter is not capital would be very useful
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.