Java Picture compression Policy description

Source: Internet
Author: User
  1. Generated using Java native or using a third-party jar.

    Problems that exist:

    1. Native efficiency is slow, and the code coupling is too high, support format is few, other not much try

    2. Use Thumbnailator.jar third party. Not high efficiency, compressed picture quality is too low. The support format is small, if the original image suffix is. jpg changed to. png, the operation cannot be supported. When a PNG picture is saved as transparent, the compressed image will appear with a serious color imbalance. Too high a coupling with the code

    The above two and the code is too high coupling, so how to exist when the program, the image processing will become and weak.

    2. Therefore I recommend using the following solution: Nginx to handle.

    A. Using Nginx's own image generation strategy, only support JPEG, GIF, or PNG images (not supported in other formats such as BMP), return 415 On error, need to import Ngx_http_image_filter_module module

    B.graphicsmagick+im4java+nginx+lua+nginx_lua module uses the advantages of graphicsmagick, processing pictures fast, high quality, dynamic and code decoupling, support more formats, more types of operation, basic no down machine, high scalability

Java Picture compression Policy description

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.