private static void expand_right_edge(byte[][] image_data, int startInputRow, int num_rows, int input_cols, int output_cols) { int numcols = output_cols - input_cols; if (numcols > 0) { for (int row = startInputRow; row < (startInputRow + num_rows); row++) { /* don't need GETJSAMPLE() here */ byte pixval = image_data[row][input_cols - 1]; for (int count = 0; count < numcols; count++) image_data[row][input_cols + count] = pixval; } } } }