When on travel.state.gov's photo editor, I get
Image is overly compressed. Please use a compression ratio that is less than 20:1
Is there anyway to get past this screen in the application given a jpg file? Can I open it up in a gimp and make less-compressed knowing the quality won't be better?
11 Answer
We can devise two ways to do this (1) by editing the image, or (2) by editing the JavaScript code.
How it works
Looking at the code, you can see how it's calculated from the definition of
function getCompressionRatio(e, t) { return 3 * e.naturalWidth * e.naturalHeight / t } And the call site,
var e = getCompressionRatio(image, imageNumBytes); So in the definition e is image and t is imageNumBytes. This is the assumption that the raw image is 3 bytes-per-pixel (TrueColor).
function getCompressionRatio(image, t) { return 3 * image.naturalWidth * image.naturalHeight / imageNumBytes } Our options
Editing the image: In order to get a lower "compression ratio" for your image you need only lower the numerator
( 3 * image.naturalWidth * image.naturalHeight )or raise the denominator by makingimageNumBytes(image size) bigger.Editing the JavaScript code: Alternatively this error is rendered here,
if (MAX_COMPRESSION_RATIO < e) setUI(UIModeEnum.INIT), setMessageDialog("Your photo has been rejected for the following reason(s):", [{ description: "Image is overly compressed. Please use a compression ratio that is less than 20:1" }]), showControls(!0, ["divMessages"]);In Chrome you can open up the developer console (Ctrl + Shift + J) and run,
MAX_COMPRESSION_RATIO = InfinityAnd then the conditional will never trigger and you won't get that error.