diff --git a/README.md b/README.md index 97e44669..9c537de0 100644 --- a/README.md +++ b/README.md @@ -81,3 +81,16 @@ http://localhost:4242/ ### Important Be sure, that you are running Docker Desktop under Windows or Mac before you can run the make command. + +## Using Local Images + +If you're saving a lot of cards custom images you might hit the data limit for uploaded images (about 2MB). + +You can avoid this by putting the image files in the `local_art` directory of this repo. Then, when selecting the image in the Art tab of the card creator, instead of uploading the image you can type the file name in the "Via URL" field. This will use the image directly from the `local_art` directory instead of needing to store the whole image in the save file. + +For example if you add the file: +`cardconjurer/local_art/my_art.jpg` + +You can load it in the "Via URL" box by typing: +`my_art.jpg` +then hitting enter. diff --git a/js/creator-23.js b/js/creator-23.js index 1a66b0d5..64ccf90c 100644 --- a/js/creator-23.js +++ b/js/creator-23.js @@ -2190,7 +2190,10 @@ function setRoundedCorners(value) { //Various loaders function imageURL(url, destination, otherParams) { var imageurl = url; - if (params.get('noproxy') != '') { + // If an image URL does not have HTTP in it, assume it's a local file in the repo local_art directory. + if (!url.includes('http')) { + imageurl = '/local_art/' + url; + } else if (params.get('noproxy') != '') { //CORS PROXY LINKS //Previously: https://cors.bridged.cc/ imageurl = 'https://api.codetabs.com/v1/proxy?quest=' + url; diff --git a/local_art/.gitignore b/local_art/.gitignore new file mode 100644 index 00000000..d6b7ef32 --- /dev/null +++ b/local_art/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore