"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "zxingorg/src/main/java/com/google/zxing/web/ChartServlet.java" between
zxing-zxing-3.4.1.tar.gz and zxing-zxing-3.5.0.tar.gz

About: ZXing ("zebra crossing") is a multi-format 1D/2D barcode image processing library implemented in Java, with ports to other languages. Info: Project is in maintenance mode (no active development).

ChartServlet.java  (zxing-zxing-3.4.1):ChartServlet.java  (zxing-zxing-3.5.0)
skipping to change at line 146 skipping to change at line 146
response.setContentType(contentType); response.setContentType(contentType);
response.setContentLength(imageData.length); response.setContentLength(imageData.length);
response.setHeader("Cache-Control", "public"); response.setHeader("Cache-Control", "public");
response.getOutputStream().write(imageData); response.getOutputStream().write(imageData);
} }
private static ChartServletRequestParameters doParseParameters(ServletRequest request, boolean readBody) private static ChartServletRequestParameters doParseParameters(ServletRequest request, boolean readBody)
throws IOException { throws IOException {
Preconditions.checkArgument("qr".equals(request.getParameter("cht")), "Bad t String chartType = request.getParameter("cht");
ype"); Preconditions.checkArgument(chartType == null || "qr".equals(chartType), "Ba
d type");
String widthXHeight = request.getParameter("chs"); String widthXHeight = request.getParameter("chs");
Preconditions.checkNotNull(widthXHeight, "No size"); Preconditions.checkNotNull(widthXHeight, "No size");
int xIndex = widthXHeight.indexOf('x'); int xIndex = widthXHeight.indexOf('x');
Preconditions.checkArgument(xIndex >= 0, "Bad size"); Preconditions.checkArgument(xIndex >= 0, "Bad size");
int width = Integer.parseInt(widthXHeight.substring(0, xIndex)); int width = Integer.parseInt(widthXHeight.substring(0, xIndex));
int height = Integer.parseInt(widthXHeight.substring(xIndex + 1)); int height = Integer.parseInt(widthXHeight.substring(xIndex + 1));
Preconditions.checkArgument(width > 0 && height > 0, "Bad size"); Preconditions.checkArgument(width > 0 && height > 0, "Bad size");
Preconditions.checkArgument(width <= MAX_DIMENSION && height <= MAX_DIMENSIO N, "Bad size"); Preconditions.checkArgument(width <= MAX_DIMENSION && height <= MAX_DIMENSIO N, "Bad size");
String outputEncodingName = request.getParameter("choe"); String outputEncodingName = request.getParameter("choe");
Charset outputEncoding = StandardCharsets.UTF_8; Charset outputEncoding;
if (outputEncodingName != null) { if (outputEncodingName == null) {
outputEncoding = StandardCharsets.UTF_8;
} else {
outputEncoding = Charset.forName(outputEncodingName); outputEncoding = Charset.forName(outputEncodingName);
Preconditions.checkArgument(SUPPORTED_OUTPUT_ENCODINGS.contains(outputEnco ding), "Bad output encoding"); Preconditions.checkArgument(SUPPORTED_OUTPUT_ENCODINGS.contains(outputEnco ding), "Bad output encoding");
} }
ErrorCorrectionLevel ecLevel = ErrorCorrectionLevel.L; ErrorCorrectionLevel ecLevel = ErrorCorrectionLevel.L;
int margin = 4; int margin = 4;
String ldString = request.getParameter("chld"); String ldString = request.getParameter("chld");
if (ldString != null) { if (ldString != null) {
int pipeIndex = ldString.indexOf('|'); int pipeIndex = ldString.indexOf('|');
 End of changes. 2 change blocks. 
4 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)