Z-Blog Application Center > PHP plug-in >Save remote pictures and compress them to support watermarks

Save remote pictures and compress them to support watermarks

  • ID : mo_maximg
  • edition : 5.3.5
  • author : Sleeping in the desert ( Author website )  Contact author
  • Official website : https://www.mijupai.com/zbpplugin/15431.html
  • system requirements : Z-BlogPHP 1.7.0 Tenet
  • Update Date : 2024-01-28 18:23:14   Updated within three months
  • amount of downloads : five thousand nine hundred and twenty-four
  • Scoring : The average score of 48 people voting is 9.63/10
  • PHP version : 7.0 and higher
  • size : 6.38MB

Please login

Plug in description

           

1. Save and replace the remote pictures in the article to the local. The new article will take effect after the plug-in is enabled.
2. Almost all suffix images (including but not limited to regular. jpg. png. gif, special. php. web, etc.) can be downloaded, compressed, and watermarked
2.1. Only images with HTTP status code of 200 are supported. If the image address is 301, 302 to another address, it may not be downloaded, and the image content is empty (ZBlogPHP1.7.2 and above versions support 3 jumps, see 5.1.0 update instructions for details)
2.2. It hardly supports anti-theft chains or pictures that need COOKIE to display normally
2.3 Support most Chinese URL image addresses
3. If the image width/height is greater than the specified width, it will be compressed;
4. The quality of saved pictures can be customized.
5. The default gif dynamic image is skipped directly, and the optional switch is to download only without compression and watermark
6. png images can be compressed in jpeg form (image quality) and given the correct image suffix
7. The historical article processing function is required, but it is not guaranteed to be usable due to interference from other plug-ins. The historical article processing function only receives suggestions and real bugs, not as after-sales conditions



The charging plug-in should have good after-sales service. After sales QQ: View plug-in description after purchase , remark "Order No.".
Please open the screenshot of the development mode, or directly submit the source code of the article reporting errors.



For more information, please see the update description below


More interesting and practical SEO tools, please go to ZBlogSEO Toolkit



5.3.4

Fix the problem that the text watermark cannot be generated correctly


5.3.3

Fix a bug in the plug-in calling interface


5.3.2

Adjust the error report of PHP 8.1 and above


5.3.1

Adjust public methods


5.3.0

Added support for Chinese picture url addresses


5.2.4

New random position of image watermark position


5.2.3

Handle the problem that the modified text does not work properly when using the text watermark


5.2.2

Handle an unexpected error in calling the watermark address


5.2.1

Handle an unexpected 5.2.0 bug that causes an infinite loop


5.2.0

1. Adjust the page display style

2. Fix the problem that when the image cannot be identified and only download is enabled, the image is successfully downloaded but the article is not updated to the new address

3. Handle the verification problem when the application center fails to connect normally


5.1.6

Adjust the default UA to solve the problem of some sites blacklisting ZB's default UA


5.1.5

Handle account verification when the application center cannot be accessed


5.1.4

Fix the problem that the watermark image generated by high users in the previous version was modified


5.1.3

1. Add a white list of image domain names

1.1. Pictures with specified domain name prefix and image address will not be downloaded and compressed

1.2. It is recommended to exclude domain names starting with http


5.1.2

Fix the infinite loop bug after 5.1.1 update


5.1.1

Fix a bug, adjust the minimum version of PHP, and the historical version will not be affected


5.1.0

1. Add jump times

This function only supports ZBlog PHP version 1.7.2 and above

1.1. Only for servers with php security mode enabled or open_basedir enabled

1.2. Now supports 301 and 302 image address jump download in some cases

1.3. Support up to 3 jumps


5.0.2

1. Fix some variable name errors

2. When downloading only, do not judge the picture type



5.0.1

Fix double attachment writing caused by active upload


5.0.0

1. Reconstruct the download. When only downloading pictures, the running speed increases by 40%

2. Reconstruct the attachment data and save the data correctly

3. Improve compression efficiency and reduce memory usage

4. Fix the problem of control failure when watermark selection is special

5. Now, the maximum pixel of watermark text is 30, and it is no longer allowed to be modified to more than 30

6. Now, the watermark text can be correctly centered (default font test)


4.1.5(2021-05-21)

1. Fix the problem that the watermark offset is invalid in some cases

2. Description:

2.1. The watermark offset is based on the default 9 positions. If the value is too large, the watermark may not be visible


4.1.4(2021-02-22)

1. Fix the problem that the image has been uploaded but the displayed path is incorrect when the remote image saving directory and active upload image compression are enabled

1.1. Now restore to the system default users/year/month


4.1.3(2021-02-06)

1. Fix the problem of using the wrong suffix when saving pictures with some dynamic addresses


4.1.2(2021-02-05)

1. Add an unexpected return. Users who use active upload in article editing must update it, or an error will be reported


4.1.1(2021-02-04)

1. Another disgusting picture status problem


4.1.0(2021-02-04)

1. Add compression and watermark processing for pictures other than jpeg, jpg, png and gif

1.1. Some special wbmp and web images can also be compressed and watermarked normally

1.2. All special image types will be modified to jpg format, and the compression rate of jpg format will be used

2. Optimize the return results of the historical article processing page

2.1. After clicking Start now, if the content is finished processing, it cannot be clicked again

2.2. Now the returned results will appear in the text box and scroll with the content, rather than the page content and scroll with the browser

2.3. Historical article processing is only for free, not for after-sales

3. Fix the problem that active upload fails to compress and watermark normally

3.1. Now uploading will also support some special image formats synchronously


4.0.2(2021-02-01)

1. Judge and optimize a function that may not be enabled in PHP


4.0.1(2021-01-31)

1. Temporarily fix a function name error


4.0.0(2021-01-31)

1. Adjust processing logic

2. Optimize image processing time to a certain extent

3. Adjust the generated text watermark to some extent (the problem of generating text image baseline based on GD library) (when the font size is set unreasonably, the content may not be displayed completely)

4. Optimize some problems in handling historical articles

5. The returned results of historical articles are more humanistic


3.7.1 (Updated 2021-01-14)

1. Fix the unexpected error reported to JS in "Historical Article Processing"

2. Correctly identify whether articles exist in the optimization of "historical article processing"


3.7 (Updated on April 16, 2020)

1. Add

1.1. Download, compress, and watermark remote images in historical articles

 image.png

three point six

1. Add

1.1. Many people ask me why I cannot compress and watermark images uploaded by UE

1.2. Well, here comes the function you need

1.3. This item is added in this update

1.4. The suffix of PNG pictures uploaded actively will not change even if "PNG pictures are compressed with JPG" is enabled

1.5. Active uploaded GIF images are not compressed or watermarked by default (I believe GIF is a pit)

1.6. The size of the image file uploaded actively is the original size displayed in the file management, and the size after uncompressed+watermark

2. Optimization

2.1. Optimize the content again

3. Precautions

3.0. "Active Upload Image Compression+Watermark" Please be cautious

3.1. After the active upload compression+watermark is enabled, all uploaded pictures relying on the upload function of UE will be compressed+watermark

3.2. The upload function of other editors will also be compressed+watermarked

3.3. When this plug-in is opened and then other cloud storage plug-ins are opened, the uploaded images will be compressed and watermarked

 image.png image.png


three point five

1. Repair

1.1. Fix the problem that when PHP timeout occurs, some remote images in the article have been downloaded, but they have not been modified to local addresses due to timeout, resulting in the need for a second download for resubmission

1.2. Fix the error of not downloading when the GIF download is not enabled


3.4 Update: (This is a major update every six months)

1. Optimization

1.1. Optimize structure code, clear redundant code, improve compression and watermark speed, and reduce memory occupation

1.1.1. An error may be reported when downloading, compressing, and watermarking large remote image files

1.1.2. Large file can adjust PHP script memory limit and timeout limit

1.1.2.1. As a developer, I don't agree with you. I suggest you compress the image manually or just download the image

1.2. Optimize the configuration page and clear unnecessary items

1.2.1. Now you can automatically determine whether to add HTTP protocol

1.2.2. Now it can automatically judge whether the picture exists. If it does not exist, it will not be downloaded but only replaced with the local address

1.2.3. Now the image type can be automatically judged and the correct image suffix can be given

2. Add

2.1. Now you can customize the font file of the watermark. The default is "Song Dynasty GB2312". If you need to adjust it, please replace it on the watermark setting page

2.2. Now you can add judgment. When the image is smaller than the specified width and height, no watermark will be added

2.2.1. This is to prevent the watermark from being larger than the image, resulting in watermark failure

2.3. You can now customize the distance between the watermark and the upper, lower, left and right margins

2.3.1. This is to avoid the unsightly appearance of the watermark caused by the existence of various top corners

2.4. You can now adjust the download mode to download only without compression and watermark

2.4.1. This is to prevent the memory occupied by compression and watermark from exceeding the limit due to large remote images

2.5. PNG pictures can now be compressed in the form of JPG pictures

2.5.1. This is to further compress the image size

2.5.2. The transparent part of the PNG image compressed by JPG will be filled by the white background, that is, the image will lose transparency, please select according to the actual needs

2.5.3. This is a switch. If it needs to be turned on, please turn on the switch

3. Adjustment

3.1. Adjust the GIF and do not download it by default (mainly because most GIF files are too large)

3.1.1. Whether the optional GIF is downloaded, please turn on the switch to download


3.3 Update:

1. Add a new test function: when you select to modify the remote image storage directory, modify the attachment management image address (the image cannot be displayed normally before the plug-in function is enabled: the original address does not match the modified one) and customize the maximum width and height of the image display.

1.1 The image address judgment function can be enabled. After enabling, it will automatically judge whether the image address is a new address or an old address


3.2 Update:

1. Add: When the SRC of the picture has no normal suffix, it will automatically determine and add the correct suffix.


3.1 Update:

1. Fix the problem that the watermark cannot be saved when the maximum width and height are less than the preset value.


3.0 Update

1. Add image watermark function

(This function was first suggested by 's447889763' and 'wei520rt')

2. The color of the watermark function is HTML5 control. If it cannot be displayed normally, please upgrade it to a browser that supports HTML5

3. The watermark function is built on the premise of compression. If you do not want to compress but only set the watermark, please adjust the picture quality to the maximum, and adjust the width and height determined by compression to infinity, for example: 9999999

4. The watermark may be separated from the compression in the future, please wait.

5. Optimize the remote picture download process.

 image.png


2.2 Update:

1. Happy Pig Year

2. Repair some bugs


2.1 Update:

1. Add test play method

1.1 When directly copying or collecting some sites, if the image address is "//www.mijupai. com/" and other similar addresses, the remote image download will be unable to identify the image source address, which will lead to the failure of remote download. Enabling this function will complete the image address as“ http://www.mijupai.com/

1.2 If the image address is“ http://www.mijupai.com/demo.jpg?width/900/height/450 ”When such an address is used, the remote image download will not recognize the image source address, which will lead to the failure of remote download. If this function is enabled, the image address can be modified to“ http://www.mijupai.com/demo.jpg

Batch compression of local pictures has been launched: Image batch compression tool Welcome to download!


2.0 Update:

1. Readjust the remote picture saving method

2. Fix the black background when the remote picture is not completely downloaded

3. Fix the incorrect display image size

4. Fix the incorrect display picture type

5. Delete the maximum size of the image as a judgment, because it may not play a proper role in the code, so delete it temporarily. If you need, you can leave a message for me and consider adding it as appropriate.

6. New test function:

6.1. Add to judge whether remote pictures can be downloaded (for example, anti-theft chain, remote pictures have been deleted, etc.), because when the article pictures are directly copied or collected, the remote picture cache (copy 304) may be captured or the remote download (collection 404) is not possible, an error will be reported

6.2. This function is only available to some users who need it,


1.4 Update:

1. Increase the maximum height determination

2. Add whether the remote picture is damaged. When the remote picture is damaged, only blank pictures will be downloaded


The optimization method has been preliminarily determined, and the following problems will be dealt with in the next update:

1. The optimization adjustment is saved directly after downloading

2. The optimization completion speed is doubled, and the short time is about 50% of the original

3. Add the maximum height as one of the criteria (although it may not be useful)

3. Add and modify remote picture saving directory

 image.png

matters needing attention:

  1. It is incompatible with other third-party cloud storage tools, such as Qiniu Cloud Storage, AliCloud OSS, and so on. It seems that this has a higher priority, probably because of the successful interface of the call release. The connection to third-party cloud storage will be tested in the future (if feasible).


Original image: (size 306K) Since the uploaded image from the zb application center will be automatically compressed, the external image will be called

 1.jpg

After compression: (image quality 85, compressed size 54K)

 9.jpg

After compression: (picture quality 75, compressed size 39K)

 2.jpg

Hello, Z Blog related website has opened the real name system, please log in Bind your phone , and then make comments. Thank you for your support.

Undertake ZB template development and customization; Undertake function plug-in customization

ZBLOG Application Center - Application Purchase and Use Agreement


1. Before purchasing an app, you need to confirm whether the app meets your needs. Digital products do not support trial. According to Article 25 of the Consumer Protection Law, the app is a digital product downloaded online and cannot be refunded once it is downloaded and installed after purchase.
2. The application you purchased in the application center, Only the license of the application, and the ownership of the application still belongs to the application provider.
3. An application can only be used for a single account. Without the consent of the website and the application provider, No secondary release, gift, resale, lease, piracy, etc , otherwise we will Permanently close the user account And reserves the right to continue to investigate relevant responsibilities.
4. If The website containing the application is resold or given away, leased, etc. Please purchase the application with a new account or remove the application Otherwise, it will be deemed as violating the use agreement and permanently canceling the right to use the account.
5. Unless otherwise specified, the purchased applications only include relevant use rights and free update services, and the application center and application provider do not provide additional after-sales installation and other services.
6. The risks in your use of the application are entirely borne by the user, including system damage, data loss and any other risks.
seven Users shall not use this app to engage in any behavior that violates laws, regulations and social public order and good customs in any way. Users must bear all legal responsibilities for the possible consequences of their improper use, and the website and application provider will not bear any responsibility.
eight If the application provider and the website find that the user installs the application on illegal websites such as pornography, gambling, drugs and fraud, they will stop the user's use rights and services, and report the user's illegal information to the network supervision department.
9. The website and application providers reserve the right to change, restrict, freeze or terminate your use of certain content without notifying you and assuming no responsibility for you.


Purchasing Guide


1. Please first Registered account , and Sign in Application Center.
2. Directly click "Buy App" and follow the instructions.


Download Guide


1. The buyer logs in on his Z-Blog website, enters the background, and clicks the "Application Center" menu on the left menu bar.
2. On the home page of the "Application Center", log in using the application center registration account.
3. Enter "My Application Warehouse" to see the successfully purchased applications. Click "Download" to download and install them.


Other precautions


1. If you cannot normally access the application center through the background of your own website, please purchase carefully, because this may cause the application to fail to download and install smoothly.
2. If the paid application cannot be downloaded normally, please check Z-Blog and application updates in the background of your website. If you have updated to the latest version and still cannot download, please contact us in time.
3. The local settings may be overwritten when the update is applied. Please make a backup before the update.