Save point: Simpler project structure for core t-engines

This commit is contained in:
alandavis
2022-07-03 11:41:07 +01:00
parent c44ff5016a
commit 0eb8d9e142
538 changed files with 1182 additions and 1756 deletions

View File

@@ -0,0 +1,419 @@
/*
* #%L
* Alfresco Transform Core
* %%
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
* -
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* -
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
* -
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.transform.imagemagick;
import static org.alfresco.transform.common.RequestParamMap.ENDPOINT_TRANSFORM;
import static org.hamcrest.Matchers.containsString;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.Mockito.when;
import static org.springframework.http.HttpHeaders.ACCEPT;
import static org.springframework.http.HttpHeaders.CONTENT_DISPOSITION;
import static org.springframework.http.HttpHeaders.CONTENT_TYPE;
import static org.springframework.http.HttpStatus.BAD_REQUEST;
import static org.springframework.http.HttpStatus.CREATED;
import static org.springframework.http.HttpStatus.OK;
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
import static org.springframework.http.MediaType.IMAGE_PNG_VALUE;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import static org.springframework.util.StringUtils.getFilenameExtension;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.Arrays;
import java.util.Map;
import java.util.UUID;
import javax.annotation.PostConstruct;
import org.alfresco.transform.client.model.TransformReply;
import org.alfresco.transform.client.model.TransformRequest;
import org.alfresco.transform.imagemagick.transformers.ImageMagickTransformer;
import org.alfresco.transform.base.TransformController;
import org.alfresco.transform.base.AbstractTransformControllerTest;
import org.alfresco.transform.base.executors.RuntimeExec;
import org.alfresco.transform.base.executors.RuntimeExec.ExecutionResult;
import org.alfresco.transform.base.model.FileRefEntity;
import org.alfresco.transform.base.model.FileRefResponse;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import org.mockito.Mock;
import org.mockito.stubbing.Answer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
/**
* Test the ImageMagickController without a server.
* Super class includes tests for the TransformController.
*/
@WebMvcTest()
public class ImageMagickControllerTest extends AbstractTransformControllerTest
{
private static final String ENGINE_CONFIG_NAME = "imagemagick_engine_config.json";
private String PREFIX_IMAGE = "image/";
@Mock
protected ExecutionResult mockExecutionResult;
@Mock
protected RuntimeExec mockTransformCommand;
@Mock
protected RuntimeExec mockCheckCommand;
@Value("${transform.core.imagemagick.exe}")
protected String EXE;
@Value("${transform.core.imagemagick.dyn}")
protected String DYN;
@Value("${transform.core.imagemagick.root}")
protected String ROOT;
@Value("${transform.core.imagemagick.coders}")
protected String CODERS;
@Value("${transform.core.imagemagick.config}")
protected String CONFIG;
protected ImageMagickTransformer commandExecutor;
@PostConstruct
private void init()
{
commandExecutor = new ImageMagickTransformer();
}
@BeforeEach
public void before() throws IOException
{
ReflectionTestUtils.setField(commandExecutor, "transformCommand", mockTransformCommand);
ReflectionTestUtils.setField(commandExecutor, "checkCommand", mockCheckCommand);
ReflectionTestUtils.setField(controller, "commandExecutor", commandExecutor);
mockTransformCommand("jpg", "png", "image/jpg", true);
}
@Override
public String getEngineConfigName()
{
return ENGINE_CONFIG_NAME;
}
@Override
protected void mockTransformCommand(String sourceExtension,
String targetExtension, String sourceMimetype,
boolean readTargetFileBytes) throws IOException
{
this.sourceExtension = sourceExtension;
this.targetExtension = targetExtension;
this.sourceMimetype = sourceMimetype;
this.targetMimetype = PREFIX_IMAGE + targetExtension;
expectedOptions = null;
expectedSourceSuffix = null;
expectedSourceFileBytes = readTestFile(sourceExtension);
expectedTargetFileBytes = readTargetFileBytes ? readTestFile(targetExtension) : null;
sourceFile = new MockMultipartFile("file", "quick." + sourceExtension, sourceMimetype,
expectedSourceFileBytes);
when(mockTransformCommand.execute(any(), anyLong())).thenAnswer(
(Answer<RuntimeExec.ExecutionResult>) invocation -> {
Map<String, String> actualProperties = invocation.getArgument(0);
assertEquals(3, actualProperties.size(), "There should be 3 properties");
String actualOptions = actualProperties.get("options");
String actualSource = actualProperties.get("source");
String actualTarget = actualProperties.get("target");
String actualTargetExtension = getFilenameExtension(actualTarget);
assertNotNull(actualSource);
assertNotNull(actualTarget);
if (expectedSourceSuffix != null) {
assertTrue(actualSource.endsWith(expectedSourceSuffix),
"The source file \"" + actualSource + "\" should have ended in \"" + expectedSourceSuffix + "\"");
actualSource = actualSource.substring(0, actualSource.length() - expectedSourceSuffix.length());
}
assertNotNull(actualOptions);
if (expectedOptions != null)
{
assertEquals(expectedOptions, actualOptions,"expectedOptions");
}
Long actualTimeout = invocation.getArgument(1);
assertNotNull(actualTimeout);
if (expectedTimeout != null)
{
assertEquals(expectedTimeout, actualTimeout,"expectedTimeout");
}
// Copy a test file into the target file location if it exists
int i = actualTarget.lastIndexOf('_');
if (i >= 0)
{
String testFilename = actualTarget.substring(i + 1);
File testFile = getTestFile(testFilename, false);
File targetFile = new File(actualTarget);
generateTargetFileFromResourceFile(actualTargetExtension, testFile,
targetFile);
}
// Check the supplied source file has not been changed.
byte[] actualSourceFileBytes = Files.readAllBytes(new File(actualSource).toPath());
assertTrue(Arrays.equals(expectedSourceFileBytes, actualSourceFileBytes),
"Source file is not the same");
return mockExecutionResult;
});
when(mockExecutionResult.getExitValue()).thenReturn(0);
when(mockExecutionResult.getStdErr()).thenReturn("STDERROR");
when(mockExecutionResult.getStdOut()).thenReturn("STDOUT");
}
@ParameterizedTest
@ValueSource(strings = {"North", "NorthEast", "East", "SouthEast", "South", "SouthWest", "West", "NorthWest", "Center"})
public void cropGravityGoodTest(String value) throws Exception
{
expectedOptions = "-auto-orient " + "-gravity " + value + " +repage";
mockMvc
.perform(MockMvcRequestBuilders
.multipart(ENDPOINT_TRANSFORM)
.file(sourceFile)
.param("targetExtension", targetExtension)
.param("targetMimetype", targetMimetype)
.param("sourceMimetype", sourceMimetype)
.param("cropGravity", value))
.andExpect(status().is(OK.value()))
.andExpect(content().bytes(expectedTargetFileBytes))
.andExpect(header().string("Content-Disposition",
"attachment; filename*= UTF-8''quick." + targetExtension));
}
@Test
public void cropGravityBadTest() throws Exception
{
mockMvc
.perform(MockMvcRequestBuilders
.multipart(ENDPOINT_TRANSFORM)
.file(sourceFile)
.param("targetExtension", targetExtension)
.param("targetMimetype", targetMimetype)
.param("sourceMimetype", sourceMimetype)
.param("cropGravity", "badValue"))
.andExpect(status().is(BAD_REQUEST.value()));
}
@Test
public void optionsTest() throws Exception
{
expectedOptions = "-alpha remove -gravity SouthEast -crop 123x456%+90+12 +repage -thumbnail 321x654%!";
expectedSourceSuffix = "[2-3]";
mockMvc
.perform(MockMvcRequestBuilders
.multipart(ENDPOINT_TRANSFORM)
.file(sourceFile)
.param("targetExtension", targetExtension)
.param("targetMimetype", targetMimetype)
.param("sourceMimetype", sourceMimetype)
.param("startPage", "2")
.param("endPage", "3")
.param("alphaRemove", "true")
.param("autoOrient", "false")
.param("cropGravity", "SouthEast")
.param("cropWidth", "123")
.param("cropHeight", "456")
.param("cropPercentage", "true")
.param("cropXOffset", "90")
.param("cropYOffset", "12")
.param("thumbnail", "true")
.param("resizeWidth", "321")
.param("resizeHeight", "654")
.param("resizePercentage", "true")
.param("allowEnlargement", "true")
.param("maintainAspectRatio", "false"))
.andExpect(status().is(OK.value()))
.andExpect(content().bytes(expectedTargetFileBytes))
.andExpect(header().string("Content-Disposition",
"attachment; filename*= UTF-8''quick." + targetExtension));
}
@Test
public void optionsNegateBooleansTest() throws Exception
{
expectedOptions = "-auto-orient -gravity SouthEast -crop 123x456+90+12 +repage -resize 321x654>";
expectedSourceSuffix = "[2-3]";
mockMvc
.perform(MockMvcRequestBuilders
.multipart(ENDPOINT_TRANSFORM)
.file(sourceFile)
.param("targetExtension", targetExtension)
.param("targetMimetype", targetMimetype)
.param("sourceMimetype", sourceMimetype)
.param("startPage", "2")
.param("endPage", "3")
.param("alphaRemove", "false")
.param("autoOrient", "true")
.param("cropGravity", "SouthEast")
.param("cropWidth", "123")
.param("cropHeight", "456")
.param("cropPercentage", "false")
.param("cropXOffset", "90")
.param("cropYOffset", "12")
.param("thumbnail", "false")
.param("resizeWidth", "321")
.param("resizeHeight", "654")
.param("resizePercentage", "false")
.param("allowEnlargement", "false")
.param("maintainAspectRatio", "true"))
.andExpect(status().is(OK.value()))
.andExpect(content().bytes(expectedTargetFileBytes))
.andExpect(header().string("Content-Disposition",
"attachment; filename*= UTF-8''quick." + targetExtension));
}
@Test
public void deprecatedCommandOptionsTest() throws Exception
{
// Example of why the commandOptions parameter is a bad idea.
expectedOptions = "( horrible command / ); -auto-orient -resize 321x654";
mockMvc
.perform(MockMvcRequestBuilders
.multipart(ENDPOINT_TRANSFORM)
.file(sourceFile)
.param("targetExtension", targetExtension)
.param("targetMimetype", targetMimetype)
.param("sourceMimetype", sourceMimetype)
.param("thumbnail", "false")
.param("resizeWidth", "321")
.param("resizeHeight", "654")
.param("commandOptions", "( horrible command / );"))
.andExpect(status().is(OK.value()))
.andExpect(content().bytes(expectedTargetFileBytes))
.andExpect(header().string("Content-Disposition",
"attachment; filename*= UTF-8''quick." + targetExtension));
}
@Override
protected void updateTransformRequestWithSpecificOptions(TransformRequest transformRequest)
{
transformRequest.setSourceExtension("png");
transformRequest.setTargetExtension("png");
transformRequest.setSourceMediaType(IMAGE_PNG_VALUE);
transformRequest.setTargetMediaType(IMAGE_PNG_VALUE);
}
@Test
public void badExitCodeTest() throws Exception
{
when(mockExecutionResult.getExitValue()).thenReturn(1);
mockMvc.perform(mockMvcRequest(ENDPOINT_TRANSFORM, sourceFile, "targetExtension", "xxx"))
.andExpect(status().is(BAD_REQUEST.value()))
.andExpect(
status().reason(containsString("Transformer exit code was not 0: \nSTDERR")));
}
@Test
public void testPojoTransform() throws Exception
{
// Files
String sourceFileRef = UUID.randomUUID().toString();
File sourceFile = getTestFile("quick." + sourceExtension, true);
String targetFileRef = UUID.randomUUID().toString();
TransformRequest transformRequest = createTransformRequest(sourceFileRef, sourceFile);
// HTTP Request
HttpHeaders headers = new HttpHeaders();
headers.set(CONTENT_DISPOSITION, "attachment; filename=quick." + sourceExtension);
ResponseEntity<Resource> response = new ResponseEntity<>(new FileSystemResource(
sourceFile), headers, OK);
when(alfrescoSharedFileStoreClient.retrieveFile(sourceFileRef)).thenReturn(response);
when(alfrescoSharedFileStoreClient.saveFile(any()))
.thenReturn(new FileRefResponse(new FileRefEntity(targetFileRef)));
when(mockExecutionResult.getExitValue()).thenReturn(0);
// Update the Transformation Request with any specific params before sending it
updateTransformRequestWithSpecificOptions(transformRequest);
// Serialize and call the transformer
String tr = objectMapper.writeValueAsString(transformRequest);
String transformationReplyAsString = mockMvc
.perform(MockMvcRequestBuilders
.post(ENDPOINT_TRANSFORM)
.header(ACCEPT, APPLICATION_JSON_VALUE)
.header(CONTENT_TYPE, APPLICATION_JSON_VALUE)
.content(tr))
.andExpect(status().is(CREATED.value()))
.andReturn().getResponse().getContentAsString();
TransformReply transformReply = objectMapper.readValue(transformationReplyAsString,
TransformReply.class);
// Assert the reply
assertEquals(transformRequest.getRequestId(), transformReply.getRequestId());
assertEquals(transformRequest.getClientData(), transformReply.getClientData());
assertEquals(transformRequest.getSchema(), transformReply.getSchema());
}
@Test
public void testOverridingExecutorPaths()
{
//System test property values can me modified in the pom.xml
assertEquals(EXE, System.getProperty("IMAGEMAGICK_EXE"));
assertEquals(DYN, System.getProperty("IMAGEMAGICK_DYN"));
assertEquals(ROOT, System.getProperty("IMAGEMAGICK_ROOT"));
}
}

View File

@@ -0,0 +1,49 @@
/*
* #%L
* Alfresco Transform Core
* %%
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
* -
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* -
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
* -
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.transform.imagemagick;
import org.alfresco.transform.base.AbstractHttpRequestTest;
import org.springframework.boot.test.context.SpringBootTest;
/**
* Tests ImageMagickController with a server test harness.
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class ImageMagickHttpRequestTest extends AbstractHttpRequestTest
{
@Override
protected String getTransformerName()
{
return "ImageMagick";
}
@Override
protected String getSourceExtension()
{
return "jpg";
}
}

View File

@@ -0,0 +1,61 @@
/*
* #%L
* Alfresco Transform Core
* %%
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
* -
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* -
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
* -
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.transform.imagemagick;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_JPEG;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_PNG;
import java.util.UUID;
import org.alfresco.transform.client.model.TransformRequest;
import org.alfresco.transform.base.AbstractQueueTransformServiceIT;
import org.springframework.boot.test.context.SpringBootTest;
/**
* @author Lucian Tuca
* created on 15/01/2019
*/
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
properties = {"activemq.url=nio://localhost:61616"})
public class ImageMagickQueueTransformServiceIT extends AbstractQueueTransformServiceIT
{
@Override
protected TransformRequest buildRequest()
{
return TransformRequest
.builder()
.withRequestId(UUID.randomUUID().toString())
.withSourceMediaType(MIMETYPE_IMAGE_PNG)
.withTargetMediaType(MIMETYPE_IMAGE_JPEG)
.withTargetExtension("jpeg")
.withSchema(1)
.withClientData("ACS")
.withSourceReference(UUID.randomUUID().toString())
.withSourceSize(32L)
.build();
}
}

View File

@@ -0,0 +1,243 @@
/*
* #%L
* Alfresco Transform Core
* %%
* Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
* -
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* -
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
* -
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.transform.imagemagick;
import static java.text.MessageFormat.format;
import static java.util.Collections.emptyMap;
import static java.util.function.Function.identity;
import static java.util.stream.Collectors.toMap;
import static org.alfresco.transform.base.EngineClient.sendTRequest;
import static org.alfresco.transform.base.TestFileInfo.testFile;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_APPLICATION_EPS;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_BMP;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_CGM;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_GIF;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_IEF;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_JP2;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_JPEG;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_PBM;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_PGM;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_PNG;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_PNM;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_PPJ;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_PPM;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_PSD;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAS;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_3FR;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_ARW;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_CR2;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_DNG;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_K25;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_MRW;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_NEF;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_ORF;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_PEF;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_R3D;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_RAF;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_RW2;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_RWL;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_RAW_X3F;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_TIFF;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_XBM;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_XPM;
import static org.alfresco.transform.common.Mimetype.MIMETYPE_IMAGE_XWD;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;
import static org.springframework.http.HttpStatus.OK;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import org.alfresco.transform.base.TestFileInfo;
import org.apache.commons.lang3.tuple.Pair;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;
/**
* @author Cezar Leahu
*/
public class ImageMagickTransformationIT {
private static final Logger logger = LoggerFactory.getLogger(ImageMagickTransformationIT.class);
private static final String ENGINE_URL = "http://localhost:8090";
private static final List<Pair<String, String>> targetExtensions = new ImmutableList.Builder<Pair<String, String>>()
.add(Pair.of("3fr", MIMETYPE_IMAGE_RAW_3FR))
.add(Pair.of("arw", MIMETYPE_IMAGE_RAW_ARW))
.add(Pair.of("bmp", MIMETYPE_IMAGE_BMP))
.add(Pair.of("cgm", MIMETYPE_IMAGE_CGM))
.add(Pair.of("cr2", MIMETYPE_IMAGE_RAW_CR2))
.add(Pair.of("dng", MIMETYPE_IMAGE_RAW_DNG))
.add(Pair.of("eps", MIMETYPE_APPLICATION_EPS))
.add(Pair.of("gif", MIMETYPE_IMAGE_GIF))
.add(Pair.of("ief", MIMETYPE_IMAGE_IEF))
.add(Pair.of("jp2", MIMETYPE_IMAGE_JP2))
.add(Pair.of("jpg", MIMETYPE_IMAGE_JPEG))
.add(Pair.of("k25", MIMETYPE_IMAGE_RAW_K25))
.add(Pair.of("mrw", MIMETYPE_IMAGE_RAW_MRW))
.add(Pair.of("nef", MIMETYPE_IMAGE_RAW_NEF))
.add(Pair.of("orf", MIMETYPE_IMAGE_RAW_ORF))
.add(Pair.of("pbm", MIMETYPE_IMAGE_PBM))
.add(Pair.of("pef", MIMETYPE_IMAGE_RAW_PEF))
.add(Pair.of("pgm", MIMETYPE_IMAGE_PGM))
.add(Pair.of("png", MIMETYPE_IMAGE_PNG))
.add(Pair.of("pnm", MIMETYPE_IMAGE_PNM))
.add(Pair.of("ppj", MIMETYPE_IMAGE_PPJ))
.add(Pair.of("ppm", MIMETYPE_IMAGE_PPM))
.add(Pair.of("r3d", MIMETYPE_IMAGE_RAW_R3D))
.add(Pair.of("raf", MIMETYPE_IMAGE_RAW_RAF))
.add(Pair.of("ras", MIMETYPE_IMAGE_RAS))
.add(Pair.of("rw2", MIMETYPE_IMAGE_RAW_RW2))
.add(Pair.of("rwl", MIMETYPE_IMAGE_RAW_RWL))
.add(Pair.of("tiff", MIMETYPE_IMAGE_TIFF))
.add(Pair.of("x3f", MIMETYPE_IMAGE_RAW_X3F))
.add(Pair.of("xbm", MIMETYPE_IMAGE_XBM))
.add(Pair.of("xpm", MIMETYPE_IMAGE_XPM))
.add(Pair.of("xwd", MIMETYPE_IMAGE_XWD))
.build();
private static final List<Pair<String, String>> targetExtensionsForPSD = new ImmutableList.Builder<Pair<String, String>>()
.add(Pair.of("x3f", MIMETYPE_IMAGE_RAW_X3F))
.add(Pair.of("tiff", MIMETYPE_IMAGE_TIFF))
.add(Pair.of("rwl", MIMETYPE_IMAGE_RAW_RWL))
.add(Pair.of("rw2", MIMETYPE_IMAGE_RAW_RW2))
.add(Pair.of("ras", MIMETYPE_IMAGE_RAS))
.add(Pair.of("raf", MIMETYPE_IMAGE_RAW_RAF))
.add(Pair.of("r3d", MIMETYPE_IMAGE_RAW_R3D))
.add(Pair.of("psd", MIMETYPE_IMAGE_PSD))
.add(Pair.of("ppm", MIMETYPE_IMAGE_PPM))
.add(Pair.of("ppj", MIMETYPE_IMAGE_PPJ))
.add(Pair.of("pnm", MIMETYPE_IMAGE_PNM))
.add(Pair.of("pgm", MIMETYPE_IMAGE_PGM))
.add(Pair.of("pef", MIMETYPE_IMAGE_RAW_PEF))
.add(Pair.of("pbm", MIMETYPE_IMAGE_PBM))
.add(Pair.of("orf", MIMETYPE_IMAGE_RAW_ORF))
.add(Pair.of("nef", MIMETYPE_IMAGE_RAW_NEF))
.add(Pair.of("mrw", MIMETYPE_IMAGE_RAW_MRW))
.add(Pair.of("k25", MIMETYPE_IMAGE_RAW_K25))
.add(Pair.of("ief", MIMETYPE_IMAGE_IEF))
.add(Pair.of("gif", MIMETYPE_IMAGE_GIF))
.add(Pair.of("dng", MIMETYPE_IMAGE_RAW_DNG))
.add(Pair.of("cr2", MIMETYPE_IMAGE_RAW_CR2))
.add(Pair.of("arw", MIMETYPE_IMAGE_RAW_ARW))
.add(Pair.of("3fr", MIMETYPE_IMAGE_RAW_3FR))
.build();
private static final List<Pair<String, String>> targetExtensionsForTiffFirstPage = new ImmutableList.Builder<Pair<String, String>>()
.add(Pair.of("bmp", MIMETYPE_IMAGE_BMP))
.add(Pair.of("eps", MIMETYPE_APPLICATION_EPS))
.add(Pair.of("jp2", MIMETYPE_IMAGE_JP2))
.add(Pair.of("jpg", MIMETYPE_IMAGE_JPEG))
.add(Pair.of("png", MIMETYPE_IMAGE_PNG))
.add(Pair.of("xbm", MIMETYPE_IMAGE_XBM))
.add(Pair.of("xpm", MIMETYPE_IMAGE_XPM))
.add(Pair.of("xwd", MIMETYPE_IMAGE_XWD))
.build();
private static final Map<String, TestFileInfo> TEST_FILES = Stream.of(
testFile(MIMETYPE_IMAGE_BMP, "bmp", "quick.bmp"),
testFile(MIMETYPE_APPLICATION_EPS, "eps", "quick.eps"),
testFile(MIMETYPE_IMAGE_GIF, "gif", "quick.gif"),
testFile(MIMETYPE_IMAGE_JPEG, "jpg", "quick.jpg"),
testFile(MIMETYPE_IMAGE_PBM, "pbm", "quick.pbm"),
testFile(MIMETYPE_IMAGE_PGM, "pgm", "quick.pgm"),
testFile(MIMETYPE_IMAGE_PNG, "png", "quick.png"),
testFile(MIMETYPE_IMAGE_PNM, "pnm", "quick.pnm"),
testFile(MIMETYPE_IMAGE_PPM, "ppm", "quick.ppm"),
testFile(MIMETYPE_IMAGE_XBM, "xbm", "quick.xbm"),
testFile(MIMETYPE_IMAGE_XPM, "xpm", "quick.xpm"),
testFile(MIMETYPE_IMAGE_PSD, "psd", "quick.psd"),
testFile(MIMETYPE_IMAGE_TIFF, "tiff", "quick.tiff"),
testFile(MIMETYPE_IMAGE_XWD, "xwd", "quick.xwd")
).collect(toMap(TestFileInfo::getPath, identity()));
public static Stream<Pair<TestFileInfo, Pair<String,String>>> engineTransformations() {
return Stream
.of(
allTargets("quick.bmp", targetExtensions),
allTargets("quick.eps", targetExtensions),
allTargets("quick.gif", targetExtensions),
allTargets("quick.jpg", targetExtensions),
allTargets("quick.pbm", targetExtensions),
allTargets("quick.pgm", targetExtensions),
allTargets("quick.png", targetExtensions),
allTargets("quick.pnm", targetExtensions),
allTargets("quick.ppm", targetExtensions),
allTargets("quick.psd", targetExtensionsForPSD),
allTargets("quick.tiff", targetExtensions),
allTargets("quick.xbm", targetExtensions),
allTargets("quick.xpm", targetExtensions),
allTargets("quick.xwd", targetExtensions)
).flatMap(identity());
}
@ParameterizedTest
@MethodSource("engineTransformations")
public void testTransformation(Pair<TestFileInfo, Pair<String, String>> entry)
{
String sourceFile = entry.getLeft().getPath();
String targetExtension = entry.getRight().getLeft();
String sourceMimetype = entry.getLeft().getMimeType();
String targetMimetype = entry.getRight().getRight();
final String descriptor = format("Transform ({0}, {1} -> {2}, {3})",
sourceFile, sourceMimetype, targetMimetype, targetExtension);
try
{
// note: some image/tiff->image/* will return multiple page results (hence error) unless options specified for single page
Map<String, String> tOptions = emptyMap();
Pair<String,String> targetPair = Pair.of(targetExtension, targetMimetype);
if (MIMETYPE_IMAGE_TIFF.equals(sourceMimetype) && targetExtensionsForTiffFirstPage.contains(targetPair))
{
tOptions = ImmutableMap.of("startPage", "0", "endPage", "0");
}
final ResponseEntity<Resource> response = sendTRequest(ENGINE_URL, sourceFile, sourceMimetype,
targetMimetype, targetExtension, tOptions);
assertEquals(OK, response.getStatusCode(), descriptor);
}
catch (Exception e)
{
fail(descriptor + " exception: " + e.getMessage());
}
}
private static Stream<Pair<TestFileInfo, Pair<String,String>>> allTargets(final String sourceFile, List<Pair<String,String>> targetExtensionsList)
{
return targetExtensionsList
.stream()
.map(k -> Pair.of(TEST_FILES.get(sourceFile), k));
}
}

View File

@@ -0,0 +1,22 @@
{
"transformOptions": {
"engineXOptions": [
{"value": {"name": "page"}},
{"value": {"name": "width"}},
{"group": {"transformOptions": [
{"value": {"name": "cropGravity"}}
]}}
]
},
"transformers": [
{
"transformerName": "engineX",
"supportedSourceAndTargetList": [
{"sourceMediaType": "application/pdf", "targetMediaType": "image/png" }
],
"transformOptions": [
"engineXOptions"
]
}
]
}

View File

@@ -0,0 +1,10 @@
{
"transformOptions": {},
"transformers": [
{
"supportedSourceAndTargetList": [
{"sourceMediaType": "application/pdf", "targetMediaType": "image/png" }
]
}
]
}

View File

@@ -0,0 +1,10 @@
{
"transformers": [
{
"transformerName": "engineX",
"supportedSourceAndTargetList": [
{"sourceMediaType": "application/pdf", "targetMediaType": "image/png" }
]
}
]
}

View File

@@ -0,0 +1,26 @@
{
"transformOptions": {
"engineXOptions": [
{"value": {"name": "page"}},
{"value": {"name": "page"}},
{"value": {"name": "width"}},
{"group": {"transformOptions": [
{"value": {"name": "cropGravity"}}
]}}
]
},
"transformers": [
{
"transformerName": "engineX",
"supportedSourceAndTargetList": [
{"sourceMediaType": "application/pdf", "targetMediaType": "image/png" },
{"sourceMediaType": "application/pdf", "targetMediaType": "image/png" },
{"sourceMediaType": "application/pdf", "targetMediaType": "image/png" }
],
"transformOptions": [
"engineXOptions",
"engineXOptions"
]
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,201 @@
/* XPM */
static char * D:\NewQuickImages\quick_xpm[] = {
"800 190 8 1",
" c None",
". c #FFFFFF",
"+ c #000000",
"@ c #FF0000",
"# c #0000FF",
"$ c #00FF00",
"% c #FFFF00",
"& c #00FFFF",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"...............................++.......................................................................++.................++.....................................................................++++................................................................................................................................................................++..............................++....................................................++..................................................................................................................................................................................................................................................................................................................................................................",
".................++++++++++++..++.......................................................++..............++.................++....................................................................+++++.................................++.............................................................................................................................++..............................++....................................................++..................................................................................................................................................................................................................................................................................................................................................................",
".................++++++++++++..++.......................................................++..............++.................++...................................................................+++....................................++.....................................................................................................................++......++..............................++....................................................++..................................................................................................................................................................................................................................................................................................................................................................",
"......................++.......++.......................................................................++.................++...................................................................++............................................................................................................................................................++......++..............................++....................................................++..................................................................................................................................................................................................................................................................................................................................................................",
"......................++.......++.......................................................................++.................++...................................................................++............................................................................................................................................................++......++..............................++....................................................++..................................................................................................................................................................................................................................................................................................................................................................",
"......................++.......++.++++........+++++.............+++++++....++.....++....++......++++....++.....++..........++.++++.....++..+++....++++.....++....++....++...++.++++............++++++....++++.....+++....+++.........++++....++.....++....++.++++...++++.....++.++++......+++++.............++++.....++......++.....+++++.....++..+++........+++++++..++.++++........+++++............++....++++++.....+++++++++..++......++...........+++++++......++++.......+++++++..........................................................................................................................................................................................................................................................................................................................................",
"......................++.......++++++++.....++++++++...........++++++++....++.....++....++....+++++++...++....++...........++++++++....+++++++..++++++++...++....++....++...++++++++...........++++++..++++++++....++....++..........++++....++.....++....++++++++.++++++....++++++++....+++++++..........++++++++....++....++....++++++++....+++++++........+++++++..++++++++.....++++++++...........++....+++++++....+++++++++...++....++...........++++++++....++++++++....++++++++..........................................................................................................................................................................................................................................................................................................................................",
"......................++.......+++...+++....++....+++..........++....++....++.....++....++....++....+...++...++............+++...+++...+++......++....++....++...+++..++....+++...+++...........++.....++....++.....++..++.............++....++.....++....+++...++++...+++...+++...+++..++.....+..........++....++....++....++....++....+++...+++.............++......+++...+++....++....+++..........++.........+++.........+++...++....++...........++....++....++....++....++....++..........................................................................................................................................................................................................................................................................................................................................",
"......................++.......++.....++...++......++.........++.....++....++.....++....++...++.........++..++.............++.....++...++......++......++...++..++++..++....++.....++...........++....++......++.....++++..............++....++.....++....++.....++.....++...++.....++..++...............++......++...++....++...++......++...++..............++......++.....++...++......++..........++..........++........+++....++....++..........++.....++...++......++..++.....++..........................................................................................................................................................................................................................................................................................................................................",
"......................++.......++.....++...++++++++++.........++.....++....++.....++....++...++.........++.++..............++.....++...++......++......++...++..+..+..++....++.....++...........++....++......++.....++++..............++....++.....++....++.....++.....++...++.....++..++++.............++......++....++..++....++++++++++...++..............++......++.....++...++++++++++..........++......++++++.......+++......++..++...........++.....++...++......++..++.....++..........................................................................................................................................................................................................................................................................................................................................",
"......................++.......++.....++...++++++++++.........++.....++....++.....++....++...++.........+++++..............++.....++...++......++......++...++..+..+..++....++.....++...........++....++......++......++...............++....++.....++....++.....++.....++...++.....++...++++++..........++......++....++..++....++++++++++...++..............++......++.....++...++++++++++..........++....++++++++......+++.......++..++...........++.....++...++......++..++.....++..........................................................................................................................................................................................................................................................................................................................................",
"......................++.......++.....++...++.................++.....++....++.....++....++...++.........++++++.............++.....++...++......++......++....+.++..++.+.....++.....++...........++....++......++.....++++..............++....++.....++....++.....++.....++...++.....++......++++.........++......++....++..++....++...........++..............++......++.....++...++..................++...+++....++.....+++.........+..+............++.....++...++......++..++.....++..........................................................................................................................................................................................................................................................................................................................................",
"......................++.......++.....++...++.................++.....++....++.....++....++...++.........++..+++............++.....++...++......++......++....+++....+.+.....++.....++...........++....++......++.....++++..............++....++.....++....++.....++.....++...++.....++........++.........++......++.....++++.....++...........++..............++......++.....++...++..................++...++.....++....+++..........++++............++.....++...++......++..++.....++..........................................................................................................................................................................................................................................................................................................................................",
"......................++.......++.....++....+++.....+.........+++...+++....+++...+++....++....++....+...++...+++...........++....++....++.......++....++.....+++....+++.....++.....++...........++.....++....++.....++..++.............++....+++...+++....++.....++.....++...++....++...+.....++..........++....++......++++......+++.....+...++..............++......++.....++....+++.....+..........++...++....+++...+++...........++++............+++...+++....++....++...+++...+++....++....................................................................................................................................................................................................................................................................................................................................",
"......................++.......++.....++....+++++++++..........++++++++.....++++++++....++....+++++++...++....+++..........++++++++....++.......++++++++.....+++....+++.....++.....++...........++.....++++++++....++....++............++.....++++++++....++.....++.....++...++++++++...+++++++...........++++++++.......++.......+++++++++...++..............++++++..++.....++....+++++++++..........++...+++++++++...+++++++++......++..............++++++++....++++++++....++++++++....++....................................................................................................................................................................................................................................................................................................................................",
"......................++.......++.....++......++++++............++++.++......++++.++....++.....+++++....++.....+++.........++.++++.....++.........++++........++.....+......++.....++...........++.......++++.....+++....+++...........++......++++.++....++.....++.....++...+++++++.....+++++..............++++.........++.........++++++....++...............+++++..++.....++......++++++...........++....+++++.++...+++++++++......++...............++++.++......++++.......++++.++....++....................................................................................................................................................................................................................................................................................................................................",
".....................................................................++................................................................................................................................................................++....................................++.......................................................................................................................................................+.............................................++..........................................................................................................................................................................................................................................................................................................................................",
".....................................................................++...............................................................................................................................................................+++....................................++......................................................................................................................................................++............................................+++..........................................................................................................................................................................................................................................................................................................................................",
".....................................................................++............................................................................................................................................................+++++.....................................++......................................................................................................................................................++.......................................+++++++...........................................................................................................................................................................................................................................................................................................................................",
".....................................................................++............................................................................................................................................................++++......................................++.....................................................................................................................................................++........................................++++++............................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
".......................................................................................@@.......................................................................@@.................@@.....................................................................@@@@................................................................................................................................................................@@..............................@@....................................................@@..........................................................................................................................................................................................................................................................................................................",
".........................................................................@@@@@@@@@@@@..@@.......................................................@@..............@@.................@@....................................................................@@@@@.................................@@.............................................................................................................................@@..............................@@....................................................@@..........................................................................................................................................................................................................................................................................................................",
".........................................................................@@@@@@@@@@@@..@@.......................................................@@..............@@.................@@...................................................................@@@....................................@@.....................................................................................................................@@......@@..............................@@....................................................@@..........................................................................................................................................................................................................................................................................................................",
"..............................................................................@@.......@@.......................................................................@@.................@@...................................................................@@............................................................................................................................................................@@......@@..............................@@....................................................@@..........................................................................................................................................................................................................................................................................................................",
"..............................................................................@@.......@@.......................................................................@@.................@@...................................................................@@............................................................................................................................................................@@......@@..............................@@....................................................@@..........................................................................................................................................................................................................................................................................................................",
"..............................................................................@@.......@@.@@@@........@@@@@.............@@@@@@@....@@.....@@....@@......@@@@....@@.....@@..........@@.@@@@.....@@..@@@....@@@@.....@@....@@....@@...@@.@@@@............@@@@@@....@@@@.....@@@....@@@.........@@@@....@@.....@@....@@.@@@@...@@@@.....@@.@@@@......@@@@@.............@@@@.....@@......@@.....@@@@@.....@@..@@@........@@@@@@@..@@.@@@@........@@@@@............@@....@@@@@@.....@@@@@@@@@..@@......@@...........@@@@@@@......@@@@.......@@@@@@@..................................................................................................................................................................................................................................................................................",
"..............................................................................@@.......@@@@@@@@.....@@@@@@@@...........@@@@@@@@....@@.....@@....@@....@@@@@@@...@@....@@...........@@@@@@@@....@@@@@@@..@@@@@@@@...@@....@@....@@...@@@@@@@@...........@@@@@@..@@@@@@@@....@@....@@..........@@@@....@@.....@@....@@@@@@@@.@@@@@@....@@@@@@@@....@@@@@@@..........@@@@@@@@....@@....@@....@@@@@@@@....@@@@@@@........@@@@@@@..@@@@@@@@.....@@@@@@@@...........@@....@@@@@@@....@@@@@@@@@...@@....@@...........@@@@@@@@....@@@@@@@@....@@@@@@@@..................................................................................................................................................................................................................................................................................",
"..............................................................................@@.......@@@...@@@....@@....@@@..........@@....@@....@@.....@@....@@....@@....@...@@...@@............@@@...@@@...@@@......@@....@@....@@...@@@..@@....@@@...@@@...........@@.....@@....@@.....@@..@@.............@@....@@.....@@....@@@...@@@@...@@@...@@@...@@@..@@.....@..........@@....@@....@@....@@....@@....@@@...@@@.............@@......@@@...@@@....@@....@@@..........@@.........@@@.........@@@...@@....@@...........@@....@@....@@....@@....@@....@@..................................................................................................................................................................................................................................................................................",
"..............................................................................@@.......@@.....@@...@@......@@.........@@.....@@....@@.....@@....@@...@@.........@@..@@.............@@.....@@...@@......@@......@@...@@..@@@@..@@....@@.....@@...........@@....@@......@@.....@@@@..............@@....@@.....@@....@@.....@@.....@@...@@.....@@..@@...............@@......@@...@@....@@...@@......@@...@@..............@@......@@.....@@...@@......@@..........@@..........@@........@@@....@@....@@..........@@.....@@...@@......@@..@@.....@@..................................................................................................................................................................................................................................................................................",
"..............................................................................@@.......@@.....@@...@@@@@@@@@@.........@@.....@@....@@.....@@....@@...@@.........@@.@@..............@@.....@@...@@......@@......@@...@@..@..@..@@....@@.....@@...........@@....@@......@@.....@@@@..............@@....@@.....@@....@@.....@@.....@@...@@.....@@..@@@@.............@@......@@....@@..@@....@@@@@@@@@@...@@..............@@......@@.....@@...@@@@@@@@@@..........@@......@@@@@@.......@@@......@@..@@...........@@.....@@...@@......@@..@@.....@@..................................................................................................................................................................................................................................................................................",
"..............................................................................@@.......@@.....@@...@@@@@@@@@@.........@@.....@@....@@.....@@....@@...@@.........@@@@@..............@@.....@@...@@......@@......@@...@@..@..@..@@....@@.....@@...........@@....@@......@@......@@...............@@....@@.....@@....@@.....@@.....@@...@@.....@@...@@@@@@..........@@......@@....@@..@@....@@@@@@@@@@...@@..............@@......@@.....@@...@@@@@@@@@@..........@@....@@@@@@@@......@@@.......@@..@@...........@@.....@@...@@......@@..@@.....@@..................................................................................................................................................................................................................................................................................",
"..............................................................................@@.......@@.....@@...@@.................@@.....@@....@@.....@@....@@...@@.........@@@@@@.............@@.....@@...@@......@@......@@....@.@@..@@.@.....@@.....@@...........@@....@@......@@.....@@@@..............@@....@@.....@@....@@.....@@.....@@...@@.....@@......@@@@.........@@......@@....@@..@@....@@...........@@..............@@......@@.....@@...@@..................@@...@@@....@@.....@@@.........@..@............@@.....@@...@@......@@..@@.....@@..................................................................................................................................................................................................................................................................................",
"..............................................................................@@.......@@.....@@...@@.................@@.....@@....@@.....@@....@@...@@.........@@..@@@............@@.....@@...@@......@@......@@....@@@....@.@.....@@.....@@...........@@....@@......@@.....@@@@..............@@....@@.....@@....@@.....@@.....@@...@@.....@@........@@.........@@......@@.....@@@@.....@@...........@@..............@@......@@.....@@...@@..................@@...@@.....@@....@@@..........@@@@............@@.....@@...@@......@@..@@.....@@..................................................................................................................................................................................................................................................................................",
"..............................................................................@@.......@@.....@@....@@@.....@.........@@@...@@@....@@@...@@@....@@....@@....@...@@...@@@...........@@....@@....@@.......@@....@@.....@@@....@@@.....@@.....@@...........@@.....@@....@@.....@@..@@.............@@....@@@...@@@....@@.....@@.....@@...@@....@@...@.....@@..........@@....@@......@@@@......@@@.....@...@@..............@@......@@.....@@....@@@.....@..........@@...@@....@@@...@@@...........@@@@............@@@...@@@....@@....@@...@@@...@@@....@@............................................................................................................................................................................................................................................................................",
"..............................................................................@@.......@@.....@@....@@@@@@@@@..........@@@@@@@@.....@@@@@@@@....@@....@@@@@@@...@@....@@@..........@@@@@@@@....@@.......@@@@@@@@.....@@@....@@@.....@@.....@@...........@@.....@@@@@@@@....@@....@@............@@.....@@@@@@@@....@@.....@@.....@@...@@@@@@@@...@@@@@@@...........@@@@@@@@.......@@.......@@@@@@@@@...@@..............@@@@@@..@@.....@@....@@@@@@@@@..........@@...@@@@@@@@@...@@@@@@@@@......@@..............@@@@@@@@....@@@@@@@@....@@@@@@@@....@@............................................................................................................................................................................................................................................................................",
"..............................................................................@@.......@@.....@@......@@@@@@............@@@@.@@......@@@@.@@....@@.....@@@@@....@@.....@@@.........@@.@@@@.....@@.........@@@@........@@.....@......@@.....@@...........@@.......@@@@.....@@@....@@@...........@@......@@@@.@@....@@.....@@.....@@...@@@@@@@.....@@@@@..............@@@@.........@@.........@@@@@@....@@...............@@@@@..@@.....@@......@@@@@@...........@@....@@@@@.@@...@@@@@@@@@......@@...............@@@@.@@......@@@@.......@@@@.@@....@@............................................................................................................................................................................................................................................................................",
".............................................................................................................................@@................................................................................................................................................................@@....................................@@.......................................................................................................................................................@.............................................@@..................................................................................................................................................................................................................................................................................",
".............................................................................................................................@@...............................................................................................................................................................@@@....................................@@......................................................................................................................................................@@............................................@@@..................................................................................................................................................................................................................................................................................",
".............................................................................................................................@@............................................................................................................................................................@@@@@.....................................@@......................................................................................................................................................@@.......................................@@@@@@@...................................................................................................................................................................................................................................................................................",
".............................................................................................................................@@............................................................................................................................................................@@@@......................................@@.....................................................................................................................................................@@........................................@@@@@@....................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"...............................................................................................................................................##.......................................................................##.................##.....................................................................####................................................................................................................................................................##..............................##....................................................##..................................................................................................................................................................................................................................................",
".................................................................................................................................############..##.......................................................##..............##.................##....................................................................#####.................................##.............................................................................................................................##..............................##....................................................##..................................................................................................................................................................................................................................................",
".................................................................................................................................############..##.......................................................##..............##.................##...................................................................###....................................##.....................................................................................................................##......##..............................##....................................................##..................................................................................................................................................................................................................................................",
"......................................................................................................................................##.......##.......................................................................##.................##...................................................................##............................................................................................................................................................##......##..............................##....................................................##..................................................................................................................................................................................................................................................",
"......................................................................................................................................##.......##.......................................................................##.................##...................................................................##............................................................................................................................................................##......##..............................##....................................................##..................................................................................................................................................................................................................................................",
"......................................................................................................................................##.......##.####........#####.............#######....##.....##....##......####....##.....##..........##.####.....##..###....####.....##....##....##...##.####............######....####.....###....###.........####....##.....##....##.####...####.....##.####......#####.............####.....##......##.....#####.....##..###........#######..##.####........#####............##....######.....#########..##......##...........#######......####.......#######..........................................................................................................................................................................................................................",
"......................................................................................................................................##.......########.....########...........########....##.....##....##....#######...##....##...........########....#######..########...##....##....##...########...........######..########....##....##..........####....##.....##....########.######....########....#######..........########....##....##....########....#######........#######..########.....########...........##....#######....#########...##....##...........########....########....########..........................................................................................................................................................................................................................",
"......................................................................................................................................##.......###...###....##....###..........##....##....##.....##....##....##....#...##...##............###...###...###......##....##....##...###..##....###...###...........##.....##....##.....##..##.............##....##.....##....###...####...###...###...###..##.....#..........##....##....##....##....##....###...###.............##......###...###....##....###..........##.........###.........###...##....##...........##....##....##....##....##....##..........................................................................................................................................................................................................................",
"......................................................................................................................................##.......##.....##...##......##.........##.....##....##.....##....##...##.........##..##.............##.....##...##......##......##...##..####..##....##.....##...........##....##......##.....####..............##....##.....##....##.....##.....##...##.....##..##...............##......##...##....##...##......##...##..............##......##.....##...##......##..........##..........##........###....##....##..........##.....##...##......##..##.....##..........................................................................................................................................................................................................................",
"......................................................................................................................................##.......##.....##...##########.........##.....##....##.....##....##...##.........##.##..............##.....##...##......##......##...##..#..#..##....##.....##...........##....##......##.....####..............##....##.....##....##.....##.....##...##.....##..####.............##......##....##..##....##########...##..............##......##.....##...##########..........##......######.......###......##..##...........##.....##...##......##..##.....##..........................................................................................................................................................................................................................",
"......................................................................................................................................##.......##.....##...##########.........##.....##....##.....##....##...##.........#####..............##.....##...##......##......##...##..#..#..##....##.....##...........##....##......##......##...............##....##.....##....##.....##.....##...##.....##...######..........##......##....##..##....##########...##..............##......##.....##...##########..........##....########......###.......##..##...........##.....##...##......##..##.....##..........................................................................................................................................................................................................................",
"......................................................................................................................................##.......##.....##...##.................##.....##....##.....##....##...##.........######.............##.....##...##......##......##....#.##..##.#.....##.....##...........##....##......##.....####..............##....##.....##....##.....##.....##...##.....##......####.........##......##....##..##....##...........##..............##......##.....##...##..................##...###....##.....###.........#..#............##.....##...##......##..##.....##..........................................................................................................................................................................................................................",
"......................................................................................................................................##.......##.....##...##.................##.....##....##.....##....##...##.........##..###............##.....##...##......##......##....###....#.#.....##.....##...........##....##......##.....####..............##....##.....##....##.....##.....##...##.....##........##.........##......##.....####.....##...........##..............##......##.....##...##..................##...##.....##....###..........####............##.....##...##......##..##.....##..........................................................................................................................................................................................................................",
"......................................................................................................................................##.......##.....##....###.....#.........###...###....###...###....##....##....#...##...###...........##....##....##.......##....##.....###....###.....##.....##...........##.....##....##.....##..##.............##....###...###....##.....##.....##...##....##...#.....##..........##....##......####......###.....#...##..............##......##.....##....###.....#..........##...##....###...###...........####............###...###....##....##...###...###....##....................................................................................................................................................................................................................",
"......................................................................................................................................##.......##.....##....#########..........########.....########....##....#######...##....###..........########....##.......########.....###....###.....##.....##...........##.....########....##....##............##.....########....##.....##.....##...########...#######...........########.......##.......#########...##..............######..##.....##....#########..........##...#########...#########......##..............########....########....########....##....................................................................................................................................................................................................................",
"......................................................................................................................................##.......##.....##......######............####.##......####.##....##.....#####....##.....###.........##.####.....##.........####........##.....#......##.....##...........##.......####.....###....###...........##......####.##....##.....##.....##...#######.....#####..............####.........##.........######....##...............#####..##.....##......######...........##....#####.##...#########......##...............####.##......####.......####.##....##....................................................................................................................................................................................................................",
".....................................................................................................................................................................................##................................................................................................................................................................##....................................##.......................................................................................................................................................#.............................................##..........................................................................................................................................................................................................................",
".....................................................................................................................................................................................##...............................................................................................................................................................###....................................##......................................................................................................................................................##............................................###..........................................................................................................................................................................................................................",
".....................................................................................................................................................................................##............................................................................................................................................................#####.....................................##......................................................................................................................................................##.......................................#######...........................................................................................................................................................................................................................",
".....................................................................................................................................................................................##............................................................................................................................................................####......................................##.....................................................................................................................................................##........................................######............................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
".......................................................................................................................................................................................................$$.......................................................................$$.................$$.....................................................................$$$$................................................................................................................................................................$$..............................$$....................................................$$..........................................................................................................................................................................................",
".........................................................................................................................................................................................$$$$$$$$$$$$..$$.......................................................$$..............$$.................$$....................................................................$$$$$.................................$$.............................................................................................................................$$..............................$$....................................................$$..........................................................................................................................................................................................",
".........................................................................................................................................................................................$$$$$$$$$$$$..$$.......................................................$$..............$$.................$$...................................................................$$$....................................$$.....................................................................................................................$$......$$..............................$$....................................................$$..........................................................................................................................................................................................",
"..............................................................................................................................................................................................$$.......$$.......................................................................$$.................$$...................................................................$$............................................................................................................................................................$$......$$..............................$$....................................................$$..........................................................................................................................................................................................",
"..............................................................................................................................................................................................$$.......$$.......................................................................$$.................$$...................................................................$$............................................................................................................................................................$$......$$..............................$$....................................................$$..........................................................................................................................................................................................",
"..............................................................................................................................................................................................$$.......$$.$$$$........$$$$$.............$$$$$$$....$$.....$$....$$......$$$$....$$.....$$..........$$.$$$$.....$$..$$$....$$$$.....$$....$$....$$...$$.$$$$............$$$$$$....$$$$.....$$$....$$$.........$$$$....$$.....$$....$$.$$$$...$$$$.....$$.$$$$......$$$$$.............$$$$.....$$......$$.....$$$$$.....$$..$$$........$$$$$$$..$$.$$$$........$$$$$............$$....$$$$$$.....$$$$$$$$$..$$......$$...........$$$$$$$......$$$$.......$$$$$$$..................................................................................................................................................................",
"..............................................................................................................................................................................................$$.......$$$$$$$$.....$$$$$$$$...........$$$$$$$$....$$.....$$....$$....$$$$$$$...$$....$$...........$$$$$$$$....$$$$$$$..$$$$$$$$...$$....$$....$$...$$$$$$$$...........$$$$$$..$$$$$$$$....$$....$$..........$$$$....$$.....$$....$$$$$$$$.$$$$$$....$$$$$$$$....$$$$$$$..........$$$$$$$$....$$....$$....$$$$$$$$....$$$$$$$........$$$$$$$..$$$$$$$$.....$$$$$$$$...........$$....$$$$$$$....$$$$$$$$$...$$....$$...........$$$$$$$$....$$$$$$$$....$$$$$$$$..................................................................................................................................................................",
"..............................................................................................................................................................................................$$.......$$$...$$$....$$....$$$..........$$....$$....$$.....$$....$$....$$....$...$$...$$............$$$...$$$...$$$......$$....$$....$$...$$$..$$....$$$...$$$...........$$.....$$....$$.....$$..$$.............$$....$$.....$$....$$$...$$$$...$$$...$$$...$$$..$$.....$..........$$....$$....$$....$$....$$....$$$...$$$.............$$......$$$...$$$....$$....$$$..........$$.........$$$.........$$$...$$....$$...........$$....$$....$$....$$....$$....$$..................................................................................................................................................................",
"..............................................................................................................................................................................................$$.......$$.....$$...$$......$$.........$$.....$$....$$.....$$....$$...$$.........$$..$$.............$$.....$$...$$......$$......$$...$$..$$$$..$$....$$.....$$...........$$....$$......$$.....$$$$..............$$....$$.....$$....$$.....$$.....$$...$$.....$$..$$...............$$......$$...$$....$$...$$......$$...$$..............$$......$$.....$$...$$......$$..........$$..........$$........$$$....$$....$$..........$$.....$$...$$......$$..$$.....$$..................................................................................................................................................................",
"..............................................................................................................................................................................................$$.......$$.....$$...$$$$$$$$$$.........$$.....$$....$$.....$$....$$...$$.........$$.$$..............$$.....$$...$$......$$......$$...$$..$..$..$$....$$.....$$...........$$....$$......$$.....$$$$..............$$....$$.....$$....$$.....$$.....$$...$$.....$$..$$$$.............$$......$$....$$..$$....$$$$$$$$$$...$$..............$$......$$.....$$...$$$$$$$$$$..........$$......$$$$$$.......$$$......$$..$$...........$$.....$$...$$......$$..$$.....$$..................................................................................................................................................................",
"..............................................................................................................................................................................................$$.......$$.....$$...$$$$$$$$$$.........$$.....$$....$$.....$$....$$...$$.........$$$$$..............$$.....$$...$$......$$......$$...$$..$..$..$$....$$.....$$...........$$....$$......$$......$$...............$$....$$.....$$....$$.....$$.....$$...$$.....$$...$$$$$$..........$$......$$....$$..$$....$$$$$$$$$$...$$..............$$......$$.....$$...$$$$$$$$$$..........$$....$$$$$$$$......$$$.......$$..$$...........$$.....$$...$$......$$..$$.....$$..................................................................................................................................................................",
"..............................................................................................................................................................................................$$.......$$.....$$...$$.................$$.....$$....$$.....$$....$$...$$.........$$$$$$.............$$.....$$...$$......$$......$$....$.$$..$$.$.....$$.....$$...........$$....$$......$$.....$$$$..............$$....$$.....$$....$$.....$$.....$$...$$.....$$......$$$$.........$$......$$....$$..$$....$$...........$$..............$$......$$.....$$...$$..................$$...$$$....$$.....$$$.........$..$............$$.....$$...$$......$$..$$.....$$..................................................................................................................................................................",
"..............................................................................................................................................................................................$$.......$$.....$$...$$.................$$.....$$....$$.....$$....$$...$$.........$$..$$$............$$.....$$...$$......$$......$$....$$$....$.$.....$$.....$$...........$$....$$......$$.....$$$$..............$$....$$.....$$....$$.....$$.....$$...$$.....$$........$$.........$$......$$.....$$$$.....$$...........$$..............$$......$$.....$$...$$..................$$...$$.....$$....$$$..........$$$$............$$.....$$...$$......$$..$$.....$$..................................................................................................................................................................",
"..............................................................................................................................................................................................$$.......$$.....$$....$$$.....$.........$$$...$$$....$$$...$$$....$$....$$....$...$$...$$$...........$$....$$....$$.......$$....$$.....$$$....$$$.....$$.....$$...........$$.....$$....$$.....$$..$$.............$$....$$$...$$$....$$.....$$.....$$...$$....$$...$.....$$..........$$....$$......$$$$......$$$.....$...$$..............$$......$$.....$$....$$$.....$..........$$...$$....$$$...$$$...........$$$$............$$$...$$$....$$....$$...$$$...$$$....$$............................................................................................................................................................",
"..............................................................................................................................................................................................$$.......$$.....$$....$$$$$$$$$..........$$$$$$$$.....$$$$$$$$....$$....$$$$$$$...$$....$$$..........$$$$$$$$....$$.......$$$$$$$$.....$$$....$$$.....$$.....$$...........$$.....$$$$$$$$....$$....$$............$$.....$$$$$$$$....$$.....$$.....$$...$$$$$$$$...$$$$$$$...........$$$$$$$$.......$$.......$$$$$$$$$...$$..............$$$$$$..$$.....$$....$$$$$$$$$..........$$...$$$$$$$$$...$$$$$$$$$......$$..............$$$$$$$$....$$$$$$$$....$$$$$$$$....$$............................................................................................................................................................",
"..............................................................................................................................................................................................$$.......$$.....$$......$$$$$$............$$$$.$$......$$$$.$$....$$.....$$$$$....$$.....$$$.........$$.$$$$.....$$.........$$$$........$$.....$......$$.....$$...........$$.......$$$$.....$$$....$$$...........$$......$$$$.$$....$$.....$$.....$$...$$$$$$$.....$$$$$..............$$$$.........$$.........$$$$$$....$$...............$$$$$..$$.....$$......$$$$$$...........$$....$$$$$.$$...$$$$$$$$$......$$...............$$$$.$$......$$$$.......$$$$.$$....$$............................................................................................................................................................",
".............................................................................................................................................................................................................................................$$................................................................................................................................................................$$....................................$$.......................................................................................................................................................$.............................................$$..................................................................................................................................................................",
".............................................................................................................................................................................................................................................$$...............................................................................................................................................................$$$....................................$$......................................................................................................................................................$$............................................$$$..................................................................................................................................................................",
".............................................................................................................................................................................................................................................$$............................................................................................................................................................$$$$$.....................................$$......................................................................................................................................................$$.......................................$$$$$$$...................................................................................................................................................................",
".............................................................................................................................................................................................................................................$$............................................................................................................................................................$$$$......................................$$.....................................................................................................................................................$$........................................$$$$$$....................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"...............................................................................................................................................................................................................................................................%%.......................................................................%%.................%%.....................................................................%%%%................................................................................................................................................................%%..............................%%....................................................%%..................................................................................................................................",
".................................................................................................................................................................................................................................................%%%%%%%%%%%%..%%.......................................................%%..............%%.................%%....................................................................%%%%%.................................%%.............................................................................................................................%%..............................%%....................................................%%..................................................................................................................................",
".................................................................................................................................................................................................................................................%%%%%%%%%%%%..%%.......................................................%%..............%%.................%%...................................................................%%%....................................%%.....................................................................................................................%%......%%..............................%%....................................................%%..................................................................................................................................",
"......................................................................................................................................................................................................................................................%%.......%%.......................................................................%%.................%%...................................................................%%............................................................................................................................................................%%......%%..............................%%....................................................%%..................................................................................................................................",
"......................................................................................................................................................................................................................................................%%.......%%.......................................................................%%.................%%...................................................................%%............................................................................................................................................................%%......%%..............................%%....................................................%%..................................................................................................................................",
"......................................................................................................................................................................................................................................................%%.......%%.%%%%........%%%%%.............%%%%%%%....%%.....%%....%%......%%%%....%%.....%%..........%%.%%%%.....%%..%%%....%%%%.....%%....%%....%%...%%.%%%%............%%%%%%....%%%%.....%%%....%%%.........%%%%....%%.....%%....%%.%%%%...%%%%.....%%.%%%%......%%%%%.............%%%%.....%%......%%.....%%%%%.....%%..%%%........%%%%%%%..%%.%%%%........%%%%%............%%....%%%%%%.....%%%%%%%%%..%%......%%...........%%%%%%%......%%%%.......%%%%%%%..........................................................................................................",
"......................................................................................................................................................................................................................................................%%.......%%%%%%%%.....%%%%%%%%...........%%%%%%%%....%%.....%%....%%....%%%%%%%...%%....%%...........%%%%%%%%....%%%%%%%..%%%%%%%%...%%....%%....%%...%%%%%%%%...........%%%%%%..%%%%%%%%....%%....%%..........%%%%....%%.....%%....%%%%%%%%.%%%%%%....%%%%%%%%....%%%%%%%..........%%%%%%%%....%%....%%....%%%%%%%%....%%%%%%%........%%%%%%%..%%%%%%%%.....%%%%%%%%...........%%....%%%%%%%....%%%%%%%%%...%%....%%...........%%%%%%%%....%%%%%%%%....%%%%%%%%..........................................................................................................",
"......................................................................................................................................................................................................................................................%%.......%%%...%%%....%%....%%%..........%%....%%....%%.....%%....%%....%%....%...%%...%%............%%%...%%%...%%%......%%....%%....%%...%%%..%%....%%%...%%%...........%%.....%%....%%.....%%..%%.............%%....%%.....%%....%%%...%%%%...%%%...%%%...%%%..%%.....%..........%%....%%....%%....%%....%%....%%%...%%%.............%%......%%%...%%%....%%....%%%..........%%.........%%%.........%%%...%%....%%...........%%....%%....%%....%%....%%....%%..........................................................................................................",
"......................................................................................................................................................................................................................................................%%.......%%.....%%...%%......%%.........%%.....%%....%%.....%%....%%...%%.........%%..%%.............%%.....%%...%%......%%......%%...%%..%%%%..%%....%%.....%%...........%%....%%......%%.....%%%%..............%%....%%.....%%....%%.....%%.....%%...%%.....%%..%%...............%%......%%...%%....%%...%%......%%...%%..............%%......%%.....%%...%%......%%..........%%..........%%........%%%....%%....%%..........%%.....%%...%%......%%..%%.....%%..........................................................................................................",
"......................................................................................................................................................................................................................................................%%.......%%.....%%...%%%%%%%%%%.........%%.....%%....%%.....%%....%%...%%.........%%.%%..............%%.....%%...%%......%%......%%...%%..%..%..%%....%%.....%%...........%%....%%......%%.....%%%%..............%%....%%.....%%....%%.....%%.....%%...%%.....%%..%%%%.............%%......%%....%%..%%....%%%%%%%%%%...%%..............%%......%%.....%%...%%%%%%%%%%..........%%......%%%%%%.......%%%......%%..%%...........%%.....%%...%%......%%..%%.....%%..........................................................................................................",
"......................................................................................................................................................................................................................................................%%.......%%.....%%...%%%%%%%%%%.........%%.....%%....%%.....%%....%%...%%.........%%%%%..............%%.....%%...%%......%%......%%...%%..%..%..%%....%%.....%%...........%%....%%......%%......%%...............%%....%%.....%%....%%.....%%.....%%...%%.....%%...%%%%%%..........%%......%%....%%..%%....%%%%%%%%%%...%%..............%%......%%.....%%...%%%%%%%%%%..........%%....%%%%%%%%......%%%.......%%..%%...........%%.....%%...%%......%%..%%.....%%..........................................................................................................",
"......................................................................................................................................................................................................................................................%%.......%%.....%%...%%.................%%.....%%....%%.....%%....%%...%%.........%%%%%%.............%%.....%%...%%......%%......%%....%.%%..%%.%.....%%.....%%...........%%....%%......%%.....%%%%..............%%....%%.....%%....%%.....%%.....%%...%%.....%%......%%%%.........%%......%%....%%..%%....%%...........%%..............%%......%%.....%%...%%..................%%...%%%....%%.....%%%.........%..%............%%.....%%...%%......%%..%%.....%%..........................................................................................................",
"......................................................................................................................................................................................................................................................%%.......%%.....%%...%%.................%%.....%%....%%.....%%....%%...%%.........%%..%%%............%%.....%%...%%......%%......%%....%%%....%.%.....%%.....%%...........%%....%%......%%.....%%%%..............%%....%%.....%%....%%.....%%.....%%...%%.....%%........%%.........%%......%%.....%%%%.....%%...........%%..............%%......%%.....%%...%%..................%%...%%.....%%....%%%..........%%%%............%%.....%%...%%......%%..%%.....%%..........................................................................................................",
"......................................................................................................................................................................................................................................................%%.......%%.....%%....%%%.....%.........%%%...%%%....%%%...%%%....%%....%%....%...%%...%%%...........%%....%%....%%.......%%....%%.....%%%....%%%.....%%.....%%...........%%.....%%....%%.....%%..%%.............%%....%%%...%%%....%%.....%%.....%%...%%....%%...%.....%%..........%%....%%......%%%%......%%%.....%...%%..............%%......%%.....%%....%%%.....%..........%%...%%....%%%...%%%...........%%%%............%%%...%%%....%%....%%...%%%...%%%....%%....................................................................................................",
"......................................................................................................................................................................................................................................................%%.......%%.....%%....%%%%%%%%%..........%%%%%%%%.....%%%%%%%%....%%....%%%%%%%...%%....%%%..........%%%%%%%%....%%.......%%%%%%%%.....%%%....%%%.....%%.....%%...........%%.....%%%%%%%%....%%....%%............%%.....%%%%%%%%....%%.....%%.....%%...%%%%%%%%...%%%%%%%...........%%%%%%%%.......%%.......%%%%%%%%%...%%..............%%%%%%..%%.....%%....%%%%%%%%%..........%%...%%%%%%%%%...%%%%%%%%%......%%..............%%%%%%%%....%%%%%%%%....%%%%%%%%....%%....................................................................................................",
"......................................................................................................................................................................................................................................................%%.......%%.....%%......%%%%%%............%%%%.%%......%%%%.%%....%%.....%%%%%....%%.....%%%.........%%.%%%%.....%%.........%%%%........%%.....%......%%.....%%...........%%.......%%%%.....%%%....%%%...........%%......%%%%.%%....%%.....%%.....%%...%%%%%%%.....%%%%%..............%%%%.........%%.........%%%%%%....%%...............%%%%%..%%.....%%......%%%%%%...........%%....%%%%%.%%...%%%%%%%%%......%%...............%%%%.%%......%%%%.......%%%%.%%....%%....................................................................................................",
".....................................................................................................................................................................................................................................................................................................%%................................................................................................................................................................%%....................................%%.......................................................................................................................................................%.............................................%%..........................................................................................................",
".....................................................................................................................................................................................................................................................................................................%%...............................................................................................................................................................%%%....................................%%......................................................................................................................................................%%............................................%%%..........................................................................................................",
".....................................................................................................................................................................................................................................................................................................%%............................................................................................................................................................%%%%%.....................................%%......................................................................................................................................................%%.......................................%%%%%%%...........................................................................................................",
".....................................................................................................................................................................................................................................................................................................%%............................................................................................................................................................%%%%......................................%%.....................................................................................................................................................%%........................................%%%%%%............................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
".......................................................................................................................................................................................................................................................................................................................&&.......................................................................&&.................&&.....................................................................&&&&................................................................................................................................................................&&..............................&&....................................................&&..........................................................................",
".........................................................................................................................................................................................................................................................................................................&&&&&&&&&&&&..&&.......................................................&&..............&&.................&&....................................................................&&&&&.................................&&.............................................................................................................................&&..............................&&....................................................&&..........................................................................",
".........................................................................................................................................................................................................................................................................................................&&&&&&&&&&&&..&&.......................................................&&..............&&.................&&...................................................................&&&....................................&&.....................................................................................................................&&......&&..............................&&....................................................&&..........................................................................",
"..............................................................................................................................................................................................................................................................................................................&&.......&&.......................................................................&&.................&&...................................................................&&............................................................................................................................................................&&......&&..............................&&....................................................&&..........................................................................",
"..............................................................................................................................................................................................................................................................................................................&&.......&&.......................................................................&&.................&&...................................................................&&............................................................................................................................................................&&......&&..............................&&....................................................&&..........................................................................",
"..............................................................................................................................................................................................................................................................................................................&&.......&&.&&&&........&&&&&.............&&&&&&&....&&.....&&....&&......&&&&....&&.....&&..........&&.&&&&.....&&..&&&....&&&&.....&&....&&....&&...&&.&&&&............&&&&&&....&&&&.....&&&....&&&.........&&&&....&&.....&&....&&.&&&&...&&&&.....&&.&&&&......&&&&&.............&&&&.....&&......&&.....&&&&&.....&&..&&&........&&&&&&&..&&.&&&&........&&&&&............&&....&&&&&&.....&&&&&&&&&..&&......&&...........&&&&&&&......&&&&.......&&&&&&&..................................................",
"..............................................................................................................................................................................................................................................................................................................&&.......&&&&&&&&.....&&&&&&&&...........&&&&&&&&....&&.....&&....&&....&&&&&&&...&&....&&...........&&&&&&&&....&&&&&&&..&&&&&&&&...&&....&&....&&...&&&&&&&&...........&&&&&&..&&&&&&&&....&&....&&..........&&&&....&&.....&&....&&&&&&&&.&&&&&&....&&&&&&&&....&&&&&&&..........&&&&&&&&....&&....&&....&&&&&&&&....&&&&&&&........&&&&&&&..&&&&&&&&.....&&&&&&&&...........&&....&&&&&&&....&&&&&&&&&...&&....&&...........&&&&&&&&....&&&&&&&&....&&&&&&&&..................................................",
"..............................................................................................................................................................................................................................................................................................................&&.......&&&...&&&....&&....&&&..........&&....&&....&&.....&&....&&....&&....&...&&...&&............&&&...&&&...&&&......&&....&&....&&...&&&..&&....&&&...&&&...........&&.....&&....&&.....&&..&&.............&&....&&.....&&....&&&...&&&&...&&&...&&&...&&&..&&.....&..........&&....&&....&&....&&....&&....&&&...&&&.............&&......&&&...&&&....&&....&&&..........&&.........&&&.........&&&...&&....&&...........&&....&&....&&....&&....&&....&&..................................................",
"..............................................................................................................................................................................................................................................................................................................&&.......&&.....&&...&&......&&.........&&.....&&....&&.....&&....&&...&&.........&&..&&.............&&.....&&...&&......&&......&&...&&..&&&&..&&....&&.....&&...........&&....&&......&&.....&&&&..............&&....&&.....&&....&&.....&&.....&&...&&.....&&..&&...............&&......&&...&&....&&...&&......&&...&&..............&&......&&.....&&...&&......&&..........&&..........&&........&&&....&&....&&..........&&.....&&...&&......&&..&&.....&&..................................................",
"..............................................................................................................................................................................................................................................................................................................&&.......&&.....&&...&&&&&&&&&&.........&&.....&&....&&.....&&....&&...&&.........&&.&&..............&&.....&&...&&......&&......&&...&&..&..&..&&....&&.....&&...........&&....&&......&&.....&&&&..............&&....&&.....&&....&&.....&&.....&&...&&.....&&..&&&&.............&&......&&....&&..&&....&&&&&&&&&&...&&..............&&......&&.....&&...&&&&&&&&&&..........&&......&&&&&&.......&&&......&&..&&...........&&.....&&...&&......&&..&&.....&&..................................................",
"..............................................................................................................................................................................................................................................................................................................&&.......&&.....&&...&&&&&&&&&&.........&&.....&&....&&.....&&....&&...&&.........&&&&&..............&&.....&&...&&......&&......&&...&&..&..&..&&....&&.....&&...........&&....&&......&&......&&...............&&....&&.....&&....&&.....&&.....&&...&&.....&&...&&&&&&..........&&......&&....&&..&&....&&&&&&&&&&...&&..............&&......&&.....&&...&&&&&&&&&&..........&&....&&&&&&&&......&&&.......&&..&&...........&&.....&&...&&......&&..&&.....&&..................................................",
"..............................................................................................................................................................................................................................................................................................................&&.......&&.....&&...&&.................&&.....&&....&&.....&&....&&...&&.........&&&&&&.............&&.....&&...&&......&&......&&....&.&&..&&.&.....&&.....&&...........&&....&&......&&.....&&&&..............&&....&&.....&&....&&.....&&.....&&...&&.....&&......&&&&.........&&......&&....&&..&&....&&...........&&..............&&......&&.....&&...&&..................&&...&&&....&&.....&&&.........&..&............&&.....&&...&&......&&..&&.....&&..................................................",
"..............................................................................................................................................................................................................................................................................................................&&.......&&.....&&...&&.................&&.....&&....&&.....&&....&&...&&.........&&..&&&............&&.....&&...&&......&&......&&....&&&....&.&.....&&.....&&...........&&....&&......&&.....&&&&..............&&....&&.....&&....&&.....&&.....&&...&&.....&&........&&.........&&......&&.....&&&&.....&&...........&&..............&&......&&.....&&...&&..................&&...&&.....&&....&&&..........&&&&............&&.....&&...&&......&&..&&.....&&..................................................",
"..............................................................................................................................................................................................................................................................................................................&&.......&&.....&&....&&&.....&.........&&&...&&&....&&&...&&&....&&....&&....&...&&...&&&...........&&....&&....&&.......&&....&&.....&&&....&&&.....&&.....&&...........&&.....&&....&&.....&&..&&.............&&....&&&...&&&....&&.....&&.....&&...&&....&&...&.....&&..........&&....&&......&&&&......&&&.....&...&&..............&&......&&.....&&....&&&.....&..........&&...&&....&&&...&&&...........&&&&............&&&...&&&....&&....&&...&&&...&&&....&&............................................",
"..............................................................................................................................................................................................................................................................................................................&&.......&&.....&&....&&&&&&&&&..........&&&&&&&&.....&&&&&&&&....&&....&&&&&&&...&&....&&&..........&&&&&&&&....&&.......&&&&&&&&.....&&&....&&&.....&&.....&&...........&&.....&&&&&&&&....&&....&&............&&.....&&&&&&&&....&&.....&&.....&&...&&&&&&&&...&&&&&&&...........&&&&&&&&.......&&.......&&&&&&&&&...&&..............&&&&&&..&&.....&&....&&&&&&&&&..........&&...&&&&&&&&&...&&&&&&&&&......&&..............&&&&&&&&....&&&&&&&&....&&&&&&&&....&&............................................",
"..............................................................................................................................................................................................................................................................................................................&&.......&&.....&&......&&&&&&............&&&&.&&......&&&&.&&....&&.....&&&&&....&&.....&&&.........&&.&&&&.....&&.........&&&&........&&.....&......&&.....&&...........&&.......&&&&.....&&&....&&&...........&&......&&&&.&&....&&.....&&.....&&...&&&&&&&.....&&&&&..............&&&&.........&&.........&&&&&&....&&...............&&&&&..&&.....&&......&&&&&&...........&&....&&&&&.&&...&&&&&&&&&......&&...............&&&&.&&......&&&&.......&&&&.&&....&&............................................",
".............................................................................................................................................................................................................................................................................................................................................................&&................................................................................................................................................................&&....................................&&.......................................................................................................................................................&.............................................&&..................................................",
".............................................................................................................................................................................................................................................................................................................................................................&&...............................................................................................................................................................&&&....................................&&......................................................................................................................................................&&............................................&&&..................................................",
".............................................................................................................................................................................................................................................................................................................................................................&&............................................................................................................................................................&&&&&.....................................&&......................................................................................................................................................&&.......................................&&&&&&&...................................................",
".............................................................................................................................................................................................................................................................................................................................................................&&............................................................................................................................................................&&&&......................................&&.....................................................................................................................................................&&........................................&&&&&&....................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................"};

Binary file not shown.