Giter Site home page Giter Site logo

proximity's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

proximity's Issues

[REQUEST] Make the final image a layered image.

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.

Unclear required directory template_overrides

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.

https://github.com/Haven-King/Proximity/blob/ce870d9403244de55801e19a94e88c09c0d5b291/src/main/java/dev/hephaestus/proximity/Main.java#L140

The exception message thrown doesn't mention the path it was trying, so it's a bit hard to diagnose what the issue is.

https://github.com/Haven-King/Proximity/blob/ce870d9403244de55801e19a94e88c09c0d5b291/src/main/java/dev/hephaestus/proximity/templates/FileSystemTemplateSource.java#L30

Colorless Cards

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.

Too many open files

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.
CleanShot 2022-05-02 at 14 53 18@2x

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?

Optional path

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.

Image compression and command line option to drop alpha layer

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.

SVG processing error

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...

Missing color indicator for transforming DFCs, redundant p/t

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.

Bottom-line overlap when generating cards on linux

When generating a card of of the Ubuntu docker image, I get the following bottom line:

image

But when I generate images from my Mac, I get the following bottom line:

image

I don't know if this is an issue with my docker image, or if it is an image with native fonts on Ubuntu

bullet italics dash

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

Classic Template (Unreleased?)

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.

Wrong color for fetches

Prismatic Vista and Fabled Passage at least have the grey-brown color while they should be golden. Any colors land are okay though.

Consider allowing older versions of java to run the pre-built jars

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

Overriding the art on the front of a card causes the same art to be used on the back

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

decklist.txt

No set symbol

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.

Malformed Input Exception

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)

Wiki incomplete

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 :)

Generate log file after program run

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

getFileSystem error on versions 0.5.x

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!

Breeding pool

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

Core set symbols need a backdrop

Set symbols for the core sets have text with opaque borders and transparent inners. Real cards have black inner sections of text at uncommon and above, and white inner sections for commons
core

core 2

Improving readme, wiki, and ux.

This is a great project but I feel the README, the wiki, and error messages need some improvements to explain basic things.

  1. How do I build the thing (if I don't know how to gradle)?
  2. Point to the wiki in the README. Most people will otherwise miss it.
  3. Improve error messages of the application. Missing files or folders just throws an exception with questionable guidance of what's missing. Also the errors for the deck list are sometimes confusing: Island -> error, 1x Island -> okay, 1x Storm Crow-> error, empty line in a long list -> error.
  4. Why are all examples given with --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.

Artist Name font is wrong and size is to big

Compared a Proximity render to other existing scans in Photoshop and the Artist Name font is off and the size is too big by what looks to be about 2 points.

Top line is Proximity, bottom one is existing card scan
Untitled-2

dash in card name

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

Allow for passing a properties file

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)

Allow new line characters in Overrides

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.")"

Cannot invoke "java.nio.file.Path.getFileSystem()" because "path" is null

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.