Skip to content

Commit 83df54e

Browse files
committed
fixes iOS .imageset creation
.imageset now uses a Contents.json file with slightly different field names
1 parent 85018be commit 83df54e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/main/java/at/favre/tools/dconvert/converters/IOSConverter.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public String createDestinationFileNameWithoutExtension(PostfixDescriptor densit
7979
@Override
8080
public void onPreExecute(File dstFolder, String targetFileName, List<PostfixDescriptor> densityDescriptions, ImageType imageType, Arguments arguments) throws Exception {
8181
if (!arguments.dryRun && arguments.iosCreateImagesetFolders) {
82-
writeContentJson(dstFolder, targetFileName, densityDescriptions, Arguments.getOutCompressionForType(arguments.outputCompressionMode, imageType));
82+
writeContentsJson(dstFolder, targetFileName, densityDescriptions, Arguments.getOutCompressionForType(arguments.outputCompressionMode, imageType));
8383
}
8484
}
8585

@@ -88,27 +88,27 @@ public void onPostExecute(Arguments arguments) {
8888

8989
}
9090

91-
private void writeContentJson(File dstFolder, String targetFileName, List<PostfixDescriptor> iosDensityDescriptions, List<ImageType.ECompression> compressions) throws IOException {
92-
File contentJson = new File(dstFolder, "Content.json");
91+
private void writeContentsJson(File dstFolder, String targetFileName, List<PostfixDescriptor> iosDensityDescriptions, List<ImageType.ECompression> compressions) throws IOException {
92+
File contentJson = new File(dstFolder, "Contents.json");
9393

9494
if (contentJson.exists()) {
9595
contentJson.delete();
9696
}
9797
contentJson.createNewFile();
9898

9999
try (PrintWriter out = new PrintWriter(contentJson)) {
100-
out.println(createContentJson(targetFileName, iosDensityDescriptions, compressions));
100+
out.println(createContentsJson(targetFileName, iosDensityDescriptions, compressions));
101101
}
102102
}
103103

104-
private String createContentJson(String targetFileName, List<PostfixDescriptor> iosDensityDescriptions, List<ImageType.ECompression> compressions) {
104+
private String createContentsJson(String targetFileName, List<PostfixDescriptor> iosDensityDescriptions, List<ImageType.ECompression> compressions) {
105105
StringBuilder sb = new StringBuilder("{\n\t\"images\": [");
106106
for (ImageType.ECompression compression : compressions) {
107107
for (PostfixDescriptor densityDescription : iosDensityDescriptions) {
108108
sb.append("\n\t\t{\n" +
109109
"\t\t\t\"filename\": \"" + targetFileName + densityDescription.postFix + "." + compression.name().toLowerCase() + "\",\n" +
110110
"\t\t\t\"idiom\": \"universal\",\n" +
111-
"\t\t\t\"scrScale\": \"" + densityDescription.name + "\"\n" +
111+
"\t\t\t\"scale\": \"" + densityDescription.name + "\"\n" +
112112
"\t\t},");
113113
}
114114
}

0 commit comments

Comments
 (0)