mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
LQ setless images will be appended a number (1) if they exist in multiple prints in any set.
This commit is contained in:
@@ -196,24 +196,26 @@ public class ImageCache {
|
||||
s.append(ImageCache.toMWSFilename(nameToUse));
|
||||
|
||||
final int cntPictures;
|
||||
final boolean hasManyPictures;
|
||||
if (includeSet) {
|
||||
cntPictures = card.getEditionInfo(edition).getCopiesCount();
|
||||
hasManyPictures = cntPictures > 1;
|
||||
} else {
|
||||
// without set number of pictures equals number of urls provided in Svar:Picture
|
||||
String urls = backFace ? card.getPictureOtherSideUrl() : card.getPictureUrl();
|
||||
cntPictures = StringUtils.countMatches(urls, "\\\\") + 1;
|
||||
|
||||
// // raise the art index limit to the maximum of the sets this card was printed in
|
||||
// int maxCntPictures = 1;
|
||||
// for (String set : card.getSets()) {
|
||||
// maxCntPictures = Math.max(maxCntPictures, card.getEditionInfo(set).getCopiesCount());
|
||||
// }
|
||||
// cntPictures = maxCntPictures;
|
||||
// raise the art index limit to the maximum of the sets this card was printed in
|
||||
int maxCntPictures = 1;
|
||||
for (String set : card.getSets()) {
|
||||
maxCntPictures = Math.max(maxCntPictures, card.getEditionInfo(set).getCopiesCount());
|
||||
}
|
||||
hasManyPictures = maxCntPictures > 1;
|
||||
}
|
||||
|
||||
int artIdx = cp.getArtIndex();
|
||||
if (cntPictures > 1 ) {
|
||||
if ( cntPictures <= artIdx )
|
||||
if (hasManyPictures) {
|
||||
if ( cntPictures <= artIdx ) // prevent overflow
|
||||
artIdx = cntPictures == 1 ? 0 : artIdx % cntPictures;
|
||||
s.append(artIdx + 1);
|
||||
}
|
||||
|
||||
@@ -64,12 +64,12 @@ final class ImageLoader extends CacheLoader<String, BufferedImage> {
|
||||
if (null == ret && filename.contains("/")) {
|
||||
setlessFilename = filename.substring(filename.indexOf('/') + 1);
|
||||
ret = _findFile(key, path, setlessFilename);
|
||||
}
|
||||
|
||||
// try lowering the art index to the minimum for regular cards
|
||||
if (null == ret && null != setlessFilename && setlessFilename.contains(".full")) {
|
||||
if (null == ret && setlessFilename.contains(".full")) {
|
||||
ret = _findFile(key, path, setlessFilename.replaceAll("[0-9]*[.]full", "1.full"));
|
||||
}
|
||||
}
|
||||
|
||||
if (null == ret) {
|
||||
System.out.println("File not found, no image created: " + key);
|
||||
|
||||
Reference in New Issue
Block a user