You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Calculate scale so we only decode what we need
if (desiredWidth && desiredHeight) {
int wdeg = imageWidth / desiredWidth;
int hdeg = imageHeight / desiredHeight;
dec.scale_num = 1;
dec.scale_denom = std::max(1, std::min(std::min(wdeg, hdeg), 8));
}
The code to compute the scaling ratio is:
However, the following article says:
Just set the desired scaling factor of N/8 (N=1...16) in the djpeg -scale option or via the
scale_num/scale_denom
variables in library application.So I guess you should set the scale_denom to 8, and then compute the
scale_num
so thatimageWidth * scale_num / 8 <= desiredWidth
?The text was updated successfully, but these errors were encountered: