<?php

require "header.inc.php";
restore_error_handler();

$imageService = new ImageService(ACTIVE_DOCUMENTS_DIRECTORY.$_GET["code"]."/.structure.xml");
$imageService->addExternalConverter(new DesignerDocumentExternalConverter());
$imageService->setParameters(
	array(
		"action" => "convert",
		"format" => "png",
		"action2" => "resize",
		"width" => $_GET["width"],
		"height" => $_GET["height"]
	)
);
$imageService->output();