This is not a complete answer to your question, but:
Regarding JPEG quality:
Compression quality can be set using a
ImageWriteParamas described
here. They suggest using an
intvalue of 0|1 but I believe that you should
actually specify a float value between 0.0 and 1.0.
Regarding your scaling dimension issues:
From the Scalr homepage:
NOTE: If a width and height are provided that violate the image’s
proportions (e.g. attempt to resize an 800×600 image to a 150×150 square)
the library will first look at the orientation of the image
(landscape/square or portrait) and then select the primary dimension
(landscape or square uses width, portrait uses height) to recalculate a
correct secondary dimension; ignoring what was passed in by the user
that was violating the proportions.
In your case the primary dimension will be a width of 77 and thus your height
limit of 57 will be ignored.



