HXENG-64 refactor ATS (#657)

Refactor to clean up packages in the t-model and to introduce a simpler to implement t-engine base.

The new t-engines (tika, imagemagick, libreoffice, pdfrenderer, misc, aio, aspose) and t-router may be used in combination with older components as the API between the content Repo and between components has not changed. As far as possible the same artifacts are created (the -boot projects no longer exist). They may be used with older ACS repo versions.

The main changes to look for are:
* The introduction of TransformEngine and CustomTransformer interfaces to be implemented.
* The removal in t-engines and t-router of the Controller, Application, test template page, Controller tests and application config, as this is all now done by the t-engine base package.
* The t-router now extends the t-engine base, which also reduced the amount of duplicate code.
* The t-engine base provides the test page, which includes drop downs of known transform options. The t-router is able to use pipeline and failover transformers. This was not possible to do previously as the router had no test UI.
* Resources including licenses are automatically included in the all-in-one t-engine, from the individual t-engines. They just need to be added as dependencies in the pom. 
* The ugly code in the all-in-one t-engine and misc t-engine to pick transformers has gone, as they are now just selected by the transformRegistry.
* The way t-engines respond to http or message queue transform requests has been combined (eliminates the similar but different code that existed before).
* The t-engine base now uses InputStream and OutputStream rather than Files by default. As a result it will be simpler to avoid writing content to a temporary location.
* A number of the Tika and Misc CustomTransforms no longer use Files.
* The original t-engine base still exists so customers can continue to create custom t-engines the way they have done previously. the project has just been moved into a folder called deprecated.
* The folder structure has changed. The long "alfresco-transform-..." names have given way to shorter easier to read and type names.
* The t-engine project structure now has a single project rather than two. 
* The previous config values still exist, but there are now a new set for config values for in files with names that don't misleadingly imply they only contain pipeline of routing information. 
* The concept of 'routing' has much less emphasis in class names as the code just uses the transformRegistry. 
* TransformerConfig may now be read as json or yaml. The restrictions about what could be specified in yaml has gone.
* T-engines and t-router may use transform config from files. Previously it was just the t-router.
* The POC code to do with graphs of possible routes has been removed.
* All master branch changes have been merged in.
* The concept of a single transform request which results in multiple responses (e.g. images from a video) has been added to the core processing of requests in the t-engine base.
* Many SonarCloud linter fixes.
This commit is contained in:
Alan Davis
2022-09-14 13:40:19 +01:00
committed by GitHub
parent ea83ef9ebc
commit babe26b0ba
652 changed files with 19479 additions and 18195 deletions

View File

@@ -0,0 +1,59 @@
/*
* #%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.messaging.AbstractQueueIT;
/**
* @author Lucian Tuca
* created on 15/01/2019
*/
public class ImageMagickQueueIT extends AbstractQueueIT
{
@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)
.withInternalContextForTransformEngineTests()
.build();
}
}

View File

@@ -0,0 +1,406 @@
/*
* #%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.AbstractBaseTest;
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.alfresco.transform.client.model.TransformReply;
import org.alfresco.transform.client.model.TransformRequest;
import org.alfresco.transform.imagemagick.transformers.ImageMagickTransformer;
import org.junit.jupiter.api.AfterEach;
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.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.web.servlet.request.MockHttpServletRequestBuilder;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
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 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;
/**
* Test ImageMagick with mocked external command.
*/
public class ImageMagickTest extends AbstractBaseTest
{
private static String PREFIX_IMAGE = "image/";
@Autowired
private ImageMagickTransformer imageMagickTransformer;
@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;
@BeforeEach
public void before() throws IOException
{
setMockExternalCommandsOnTransformer(imageMagickTransformer, mockTransformCommand, mockCheckCommand);
mockTransformCommand("jpg", "png", "image/jpeg", true);
}
@AfterEach
public void after()
{
resetExternalCommandsOnTransformer();
}
@Override
protected MockHttpServletRequestBuilder mockMvcRequest(String url, MockMultipartFile sourceFile, String... params)
{
final MockHttpServletRequestBuilder builder = super.mockMvcRequest(url, sourceFile, params)
.param("targetMimetype", targetMimetype)
.param("sourceMimetype", sourceMimetype);
return builder;
}
@Override
public 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 + ("jpg".equals(targetExtension) ? "jpeg" : targetExtension);
expectedOptions = null;
expectedSourceSuffix = null;
sourceFileBytes = readTestFile(sourceExtension);
expectedTargetFileBytes = readTargetFileBytes ? readTestFile(targetExtension) : null;
sourceFile = new MockMultipartFile("file", "quick." + sourceExtension, sourceMimetype, sourceFileBytes);
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(sourceFileBytes, 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().isOk())
.andExpect(content().bytes(expectedTargetFileBytes))
.andExpect(header().string("Content-Disposition",
"attachment; filename*=UTF-8''transform." + 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().isOk())
.andExpect(content().bytes(expectedTargetFileBytes))
.andExpect(header().string("Content-Disposition",
"attachment; filename*=UTF-8''transform." + 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().isOk())
.andExpect(content().bytes(expectedTargetFileBytes))
.andExpect(header().string("Content-Disposition",
"attachment; filename*=UTF-8''transform." + 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().isOk())
.andExpect(content().bytes(expectedTargetFileBytes))
.andExpect(header().string("Content-Disposition",
"attachment; filename*=UTF-8''transform." + 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(sharedFileStoreClient.retrieveFile(sourceFileRef)).thenReturn(response);
when(sharedFileStoreClient.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,238 @@
/*
* #%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.clients.HttpClient.sendTRequest;
import static org.alfresco.transform.base.clients.FileInfo.testFile;
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.clients.FileInfo;
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("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("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, FileInfo> TEST_FILES = Stream.of(
testFile(MIMETYPE_IMAGE_BMP, "bmp", "quick.bmp"),
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(FileInfo::getPath, identity()));
public static Stream<Pair<FileInfo, Pair<String,String>>> engineTransformations() {
return Stream
.of(
allTargets("quick.bmp", 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<FileInfo, 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<FileInfo, 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

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.