JavaWeb: JSP self-built image API

Insert picture description here

This project is mainly used to use JSP to build its own random graph API. The source of the image is mainly the use of crawlers. Although Java can also write crawlers, it is a bit more complicated than Python. Therefore, in this project, the image Obtaining mainly uses Python.

In this case, the picture specifications (such as: type, size, etc.) are not unified. You can add it if you need it.

Because the JSP files of the two methods are put in the project, you can update and choose as needed. The default method is to directly index the image address through the jsp file . To change the method, you need to rename the original index.jsp and rename the index.jsp_BYcdn file to index.jsp .

Deploy the project directly to the server and start using it.

Update (21.2.5)

Realize image size classification:

parameter Introduction
type Picture classification: currently supports three classifications: pad , computer , phone ; the parameter can be empty, if it is empty, the random type will be selected.

###Project directory and file introduction:

  • images: save the image source file
    • pad
    • computer
    • phone
  • PythonScript: save Python scripts and configuration files
    • config.ini: project path configuration file
    • getImageFromPixivic.py: Get images from the website
    • manageGallery.py: Create a CDN link and write images.txt in
    • requirements.txt: Python script dependency library
  • images.txt: save the CDN reference link
  • index.jsp: Directly index the image address through the jsp file
  • index.jsp_BYcdn: Redirect by reading the reference link in images.txt

Method one idea

I don't have a server, so I have a choice of prostitutes. However, due to the restriction of domain name redirection, the forwarding cannot be requested.

  • Collect favorite pictures through the function of the source website
    • Or download your favorite picture
  • Download using Python crawler
  • GitHub as a graph bed
  • Use jsdelivr for citation

Method two ideas

It has its own server, which can realize request forwarding.

  • Get picture
  • Directly index the corresponding image file through jsp

Project address: image-api

Guess you like

Origin blog.csdn.net/qq_44700693/article/details/113094482