Skip to content

Commit

Permalink
Increase online decoder size limits
Browse files Browse the repository at this point in the history
  • Loading branch information
srowen committed Aug 8, 2016
1 parent b708f95 commit 77fb240
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions zxingorg/src/main/java/com/google/zxing/web/DecodeServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,20 @@
* @author Sean Owen
*/
@MultipartConfig(
maxFileSize = 10_000_000,
maxRequestSize = 10_000_000,
fileSizeThreshold = 1_000_000,
maxFileSize = 1L << 26, // ~64MB
maxRequestSize = 1L << 26, // ~64MB
fileSizeThreshold = 1 << 20, // ~1MB
location = "/tmp")
@WebServlet(value = "/w/decode", loadOnStartup = 1)
public final class DecodeServlet extends HttpServlet {

private static final Logger log = Logger.getLogger(DecodeServlet.class.getName());

// No real reason to let people upload more than a 10MB image
private static final long MAX_IMAGE_SIZE = 10_000_000L;
// No real reason to deal with more than maybe 10 megapixels
private static final int MAX_PIXELS = 10_000_000;
private static final byte[] REMAINDER_BUFFER = new byte[32768];
// No real reason to let people upload more than ~64MB
private static final long MAX_IMAGE_SIZE = 1L << 26;
// No real reason to deal with more than ~64 megapixels
private static final int MAX_PIXELS = 1 << 26;
private static final byte[] REMAINDER_BUFFER = new byte[1 << 16];
private static final Map<DecodeHintType,Object> HINTS;
private static final Map<DecodeHintType,Object> HINTS_PURE;

Expand Down

0 comments on commit 77fb240

Please sign in to comment.