Improve format logic

This commit is contained in:
Anton Thomasson 2020-08-02 11:35:18 +02:00
parent fe8dfe4d1e
commit a28d5a5d83

View file

@ -6,12 +6,12 @@ function supported_formats(printer, ConvertChecker, considerAdditionalFormats)
formats=formats+printer.additionalDocumentFormats; formats=formats+printer.additionalDocumentFormats;
} }
var raster = (has(formats, "image/pwg-raster") || has(formats, "image/urf"));
var mimetypes = []; var mimetypes = [];
var supported = []; var supported = [];
if(has(formats, "application/pdf") || if(has(formats, "application/pdf") ||
(ConvertChecker.pdf && ( has(formats, "application/postscript") || (ConvertChecker.pdf && ( has(formats, "application/postscript") || raster )))
has(formats, "image/pwg-raster") ||
has(formats, "image/urf"))) )
{ {
mimetypes.push("application/pdf"); mimetypes.push("application/pdf");
supported.push("PDF"); supported.push("PDF");
@ -22,10 +22,13 @@ function supported_formats(printer, ConvertChecker, considerAdditionalFormats)
supported.push("Postscript"); supported.push("Postscript");
} }
if ( has(formats, "image/pwg-raster") || has(formats, "image/urf")) if (raster || has(formats, "image/jpeg"))
{ {
mimetypes.push("image/jpeg"); mimetypes.push("image/jpeg");
supported.push("JPEG"); supported.push("JPEG");
}
if(raster || has(formats, "image/png"))
{
mimetypes.push("image/png"); mimetypes.push("image/png");
supported.push("PNG"); supported.push("PNG");
} }