Limit resolution choices to dpi

...because nothing else is really supported
This commit is contained in:
Anton Thomasson 2020-06-05 19:05:11 +02:00
parent 65c3ad186d
commit ed218e5278

View file

@ -156,6 +156,12 @@ function canConvertImageTo(type)
return has(targets, type) return has(targets, type)
} }
function unitsIsDpi(resolution)
{
return resolution.units == 3;
}
function limitChoices(name, choices, mimeType) function limitChoices(name, choices, mimeType)
{ {
switch(name) { switch(name) {
@ -172,6 +178,8 @@ function limitChoices(name, choices, mimeType)
{ {
return ["application/octet-stream"]; return ["application/octet-stream"];
} }
case "printer-resolution":
return choices.filter(unitsIsDpi);
default: default:
return choices; return choices;
} }