Image watermark processing method and device based on rich text editor
By obtaining and storing image addresses in the rich text editor and generating a watermark processing interface, flexible selection and batch processing of image watermarks are realized, which solves the problems of single watermark processing function and cumbersome operation in the existing technology, and improves editing efficiency and applicability.
Patent Information
- Application Number
- CN202111181046.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-11
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-10-11
AI Technical Summary
Existing rich text editors have single functions, cumbersome operations, and low efficiency in processing image watermarks. They cannot flexibly select images to embed watermarks in batches, and their applicable scenarios are limited.
By obtaining the edited content of the rich text editor for localized storage, generating a local image address, responding to the watermark trigger operation to generate a watermark processing interface that displays all images, the user can select images and watermark information to embed or cancel processing, and the server performs image watermarking Process and update content.
It realizes flexible, convenient and batch processing of image watermarks, improves user experience and editing efficiency, adapts to different embedding needs in complex environments, and improves the practicality of the image watermark processing function of the rich text editor.
Smart Images

Figure CN113887178B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software development, and in particular to a method and device for processing picture watermarks based on a rich text editor. Background Art
[0002] In the era of rapid production of new media information, information production efficiency and copyright protection are very important. The main way to protect the copyright of pictures is to add watermarks to them.
[0003] The traditional way to add watermarks to images requires the use of professional image editing tools. After adding watermarks to each image, the watermarked images are uploaded to the manuscript. This method is inefficient, so the method of embedding watermarks in rich text editors and adding watermarks to images while editing manuscripts has emerged.
[0004] However, currently, the only way to embed a watermark in a rich text editor is to modify part of the rich text editor's source code, so that the user can upload an original image first and then a watermark image. The program will combine the original image and the watermark image and display them in the rich text editor. This method has low practical value, and the process of setting a watermark every time you upload a picture is very cumbersome.
[0005] In addition, some rich text editors can add watermarks, but due to imperfect functions, the developers hide the code comments. By canceling the comments, you can use the built-in watermarking method of the rich text editor to automatically add watermarks to the pictures uploaded through the rich text editor. However, this method can only set watermarks for all pictures uniformly, which is not flexible enough and has limited application scenarios. Regardless of whether there are pictures that do not belong to the copyright or pictures that have been watermarked in the content of the rich text editor, they will all be watermarked uniformly.
[0006] It can be seen that the current rich text editors either do not implement a method for adding watermarks, or can only implement unified watermark settings, but cannot flexibly select pictures to batch embed watermarks according to scene requirements. This is an urgent problem to be solved in the optimization and transformation of rich text editors.
[0007] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0008] In view of this, the present invention provides a method and device for image watermark processing based on a rich text editor, which can solve the problems that the image watermark processing function in the rich text editor is single, the applicable scenarios are limited, the operation is cumbersome, and the efficiency is low.
[0009] One aspect of the present invention provides a method for processing image watermarks based on a rich text editor, comprising: obtaining the editing content of the rich text editor, locally storing all images in the editing content, and generating a local image address; in response to a watermark trigger operation, generating a watermark processing interface in the rich text editor that displays all the images and provides options for each image and watermark information according to the local image address; based on the original image and watermark addition information selected in the watermark processing interface, performing watermark embedding processing on the original image, and generating graphic content containing a target image embedded with a watermark in the rich text editor.
[0010] In some embodiments, the editing content includes pasted content, and obtaining the editing content of the rich text editor includes: the rich text editor listens for content paste events; when the content paste event is listened to, the rich text editor obtains the pasted content of the content paste event and submits it to the server.
[0011] In some embodiments, the localized storage of all images in the edited content and the generation of local image addresses include: the server parsing the edited content, identifying image tags in the edited content, and obtaining image addresses based on the image tags; determining whether there is an external image address in the image address; if so, the server fetching and downloading the image based on the external image address to generate a local image address, and replacing the external image address with the local image address to generate a first updated edited content, and returning to the rich text editor.
[0012] In some embodiments, after returning to the rich text editor, it also includes: the rich text editor extracts all local image addresses in the first updated editing content based on a regular expression and stores them in an array; when the rich text editor responds to the watermark trigger operation, it obtains the local image address by calling the array.
[0013] In some embodiments, the rich text editor is configured with a watermark processing button, and the watermark processing button is added to the toolbar of the rich text editor by modifying the source code or configuration file of the rich text editor; when the watermark processing button is triggered, the watermark trigger operation is generated.
[0014] In some embodiments, the watermark processing interface that displays all the images and provides selectable selection for each image and watermark information is generated in the rich text editor according to the local image address, including: the rich text editor obtains the local image address for image rendering, and generates a watermark processing interface that displays a list of all the images, and the watermark processing interface is configured with interactive controls for selecting each image and watermark information.
[0015] In some embodiments, the watermark adding information includes a watermark position and a watermark image; the watermark embedding processing of the original image is performed according to the original image selected in the watermark processing interface and the watermark adding information, including: the rich text editor submits the original image selected in the watermark processing interface, the watermark adding information and the current editing content to the server; the server embeds the watermark image at the watermark position of the original image, generates a target image embedded with the watermark, and replaces the local image address of the original image with the local image address of the target image to generate a second updated editing content, and returns to the rich text editor.
[0016] In some embodiments, the image watermark processing method further includes: performing watermark cancellation processing on the target image according to the selected target image and watermark deletion information in the watermark processing interface, and generating graphic content of the original image with the watermark cancelled in the rich text editor.
[0017] In some embodiments, the watermark cancellation processing of the target image is performed based on the selected target image and watermark deletion information of the watermark processing interface, including: the rich text editor submits the target image selected in the watermark processing interface, the watermark cancellation information and the current editing content to the server; the server replaces the local image address of the target image with the local image address of the original image corresponding to the target image to generate a third updated editing content, and returns it to the rich text editor.
[0018] Another aspect of the present invention provides a picture watermark processing device based on a rich text editor, including: a picture local storage module, used to obtain the editing content of the rich text editor, locally store all pictures in the editing content, and generate a local picture address; a visual interface generation module, used to respond to the watermark trigger operation, and generate a watermark processing interface in the rich text editor according to the local picture address, which displays all the pictures and each picture and watermark information is available for selection; a picture watermark processing module, used to perform watermark embedding processing on the original picture according to the original picture and watermark addition information selected in the watermark processing interface, and generate graphic content containing the target picture embedded with the watermark in the rich text editor.
[0019] The beneficial effects of the present invention compared with the prior art include at least:
[0020] By locally storing all images in the rich text editor, images from external sites can be automatically downloaded to the local server to prepare for batch embedding of image watermarks. The process of pre-downloading images can be synchronized with other user operations, making the user unaware and making full use of the time before the user triggers the watermark operation to improve the user experience.
[0021] When the user triggers the watermark operation, a watermark processing interface is generated based on the local image address that has been captured and downloaded, showing all images and each image and watermark information is available for selection. Through the watermark processing interface, the user can flexibly select the images to be watermarked, the watermark adding location and other information according to the scene needs, and submit them in batches to the background. The operation process is intuitive, convenient, flexible and controllable; users can also conveniently cancel / replace the added watermark through the watermark processing interface;
[0022] Based on the pictures and watermark information selected by the user, image watermark embedding processing can be performed in batches, and graphic content containing the target pictures with watermarks added can be generated and displayed in the rich text editor, so that the processing of different watermark embedding requirements in complex environments can be completed in one step, effectively improving the efficiency of image watermark embedding and the practicality of the image watermark processing function of the rich text editor.
[0023] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present invention, and together with the specification are used to explain the principles of the present invention. Obviously, the accompanying drawings described below are only some embodiments of the present invention, and for those of ordinary skill in the art, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0025] Figure 1 A schematic diagram showing the steps of a method for processing a picture watermark based on a rich text editor in one embodiment of the present invention;
[0026] Figure 2 A schematic diagram showing a rich text editor configured with a watermark processing button in one embodiment of the present invention;
[0027] Figure 3 A schematic diagram showing a watermark processing interface generated by a rich text editor in one embodiment of the present invention;
[0028] Figure 4 A schematic diagram of a watermark embedding operation interface of an existing rich text editor is shown;
[0029] Figure 5 A schematic diagram showing a process flow of a method for processing picture watermarks based on a rich text editor in one embodiment of the present invention;
[0030] Figure 6 A system module diagram showing a method for processing picture watermarks based on a rich text editor in one embodiment of the present invention;
[0031] Figure 7 A schematic diagram showing data flow of a method for processing image watermarks based on a rich text editor in one embodiment of the present invention is shown;
[0032] Figure 8 A module schematic diagram of a picture watermark processing device based on a rich text editor in one embodiment of the present invention is shown. DETAILED DESCRIPTION
[0033] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the embodiments set forth herein. Instead, these embodiments are provided to make the present invention comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art.
[0034] The accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0035] In addition, the processes shown in the accompanying drawings are only exemplary and do not necessarily include all the steps. For example, some steps can be decomposed, some steps can be combined or partially combined, and the actual execution order may change according to the actual situation. The words "first", "second" and similar words used in the specific description do not indicate any order, quantity or importance, but are only used to distinguish different components. It should be noted that the embodiments of the present invention and the features in different embodiments can be combined with each other without conflict.
[0036] Rich Text Editor (RTE) can be embedded in the browser to realize the editing of text, pictures and other contents. The picture watermark processing method based on the rich text editor of the present invention combines the rich text editor and its server, that is, the system background of the browser, to realize the visual, convenient and flexible batch watermark embedding / cancellation processing of the pictures in the rich text editor.
[0037] Figure 1 The main steps of a method for processing image watermarks based on a rich text editor in one embodiment are shown, referring to Figure 1 As shown, the image watermark processing method of this embodiment includes the following steps.
[0038] Step S110, obtaining the edited content of the rich text editor, locally storing all images in the edited content, and generating a local image address.
[0039] The rich text editor can be any existing rich text editor, such as CKeditor, Ueditor, 135 editor, Xiumi editor, etc. The edited content may include pasted content (i.e. HTML (Hyper Text Markup Language) content), and obtaining the edited content of the rich text editor specifically includes: the rich text editor monitors the content paste event; when the content paste event is monitored, the rich text editor obtains the pasted content of the content paste event and submits it to the server.
[0040] Traditional rich text editors only support watermark embedding processing for uploaded images. The present invention monitors content paste events to automatically capture and download external site images in the content copied and pasted in the rich text editor to the local computer, without the need for users to manually download uploaded images, so that the image watermark processing method is also effective for directly pasted content.
[0041] All images in the edited content are stored locally and local image addresses are generated, including: the server parses the edited content, identifies the image tags in the edited content (i.e. Tag), get the image address according to the image tag (that is, The URL path is obtained from the SCR attribute of the tag); it is determined whether there is an external image address in the image address (that is, whether there is an absolute URL path in the URL path). If so, the server crawls and downloads the image according to the external image address, generates a local image address, replaces the external image address with the local image address (that is, replaces the new access address of the downloaded image with the corresponding SCR attribute of the edited content), generates the first updated edited content, and returns to the rich text editor.
[0042] In the editing content of the rich text editor, some pictures are copied from other web pages. The picture addresses are external links. The pictures are stored on a third-party server and need to be downloaded to the local server before they can be processed. Manual downloading is inefficient, so the present invention automatically captures and downloads pictures from external sites to the local server to prepare for batch embedding of picture watermarks.
[0043] After completing the crawling and address replacement of all external link images, the server returns the newly generated HTML content, that is, the first updated edit content, to the rich text editor, and the rich text editor then calls the editor setting content method to refresh the editor content.
[0044] This step locally stores all images in the rich text editor's editing content, automatically grabs and downloads images from external sites to the local server, and prepares for batch embedding of image watermarks. The process of grabbing and downloading images in advance can be synchronized with other user operations, making the user unaware, making full use of the time before the user triggers the watermark operation, and improving the user experience.
[0045] Furthermore, if the user is to be able to select the desired image, all image addresses in the HTML source code of the rich text editor need to be extracted for backup. Therefore, after the rich text editor receives the first updated edited content, it also includes: extracting all local image addresses in the first updated edited content based on a regular expression, and storing them in an array for backup; subsequently, when the rich text editor receives a watermark trigger operation, it can quickly obtain the local image addresses in its HTML content by calling the array.
[0046] Step S120, in response to the watermark triggering operation, a watermark processing interface is generated in a rich text editor according to the local picture address, which displays all pictures and each picture and watermark information is available for selection.
[0047] The rich text editor is equipped with a watermark processing button, which can be added to the toolbar of the rich text editor by modifying the source code or configuration file of the rich text editor; when the watermark processing button is triggered, for example, the user clicks the watermark processing button, a watermark trigger operation is generated.
[0048] Figure 2 FIG. 1 shows a schematic diagram of a rich text editor configured with a watermark processing button in an embodiment, referring to FIG. Figure 2 As shown, by modifying the editor source code or configuration file, it is possible to add a watermark processing button 220 in the toolbar 210 of the rich text editor 200. The toolbar 210 of the rich text editor 200 also includes icon buttons for performing other conventional operations, such as a font setting button, a paragraph setting button, etc., which are not specifically shown in the figure.
[0049] A watermark processing interface is generated in a rich text editor according to the local image address, which displays all images and provides options for each image and watermark information. Specifically, the rich text editor calls an array to obtain the local image address for image rendering, and generates a watermark processing interface that lists all images in the current editing content (i.e., the first updated editing content mentioned above), thereby realizing visual management of the image list; in the watermark processing interface, interactive controls for selecting each image and watermark information are configured to facilitate user selection operations.
[0050] By using the custom component development SDK (Software Development Kit) of the rich text editor, or according to the development requirements of the rich text editor for custom components, it is possible to realize UI (User Interface) display and data interaction such as image list display, image selection / deselection, watermark position selection, and data submission. In the custom component interface code, the data in the above array is called to obtain the local image address and render it into the custom component interface.
[0051] When configuring the rich text editor, you need to confirm whether the rich text editor uses the automatic caching mechanism. If so, you need to cancel the automatic caching mechanism of the rich text editor. The automatic caching mechanism means that the rich text editor automatically caches the JS code of the component, and the cache cannot be cleared by conventional means. Since all displayed content of the custom components of conventional rich text editors is written in JS, including the first displayed image list obtained, which is executed as JS content, if the rich text editor uses the automatic caching mechanism, the image list information displayed in the component will not change during the validity period of the JS cache, and only the image list obtained when the JS was generated for the first time will be displayed. Under the automatic caching mechanism, even if you change other graphic content, re-login to the system, reopen the browser, refresh the cache with CTRL+F5, etc., you cannot implement batch embedding of image watermarks for new content.
[0052] Therefore, if you find that the rich text editor uses an automatic caching mechanism, you need to use front-end debugging tools such as browsers to find the dynamic JS file information automatically generated by the rich text editor when the custom component is initialized, retrieve the source code based on the information, find the code that generates the JS file, and add "? = current timestamp" code after the generated dynamic JS file name to invalidate the automatic caching mechanism of the component.
[0053] Figure 3 A schematic diagram of a rich text editor generating a watermark processing interface in an embodiment is shown, combined with Figure 2 and Figure 3As shown, when the watermark processing button 220 is triggered, the rich text editor 200 uses a custom component to realize the arrangement and display of all the pictures in the current editing content, and generates a watermark processing interface 310. The watermark processing interface 310 also provides picture selection function, watermark position selection function, watermark cancellation function, etc. Before triggering the watermark processing button 220, the user can perform text editing, graphic typesetting editing and other operations in the rich text editor 200; then the watermark processing button 220 can be triggered, and the generated watermark processing interface 310 can be used to select the picture to be watermarked and the specific watermark addition information. The user can click the "Select All" button in the watermark processing interface 310 to select all pictures 320, or individually check the selection box corresponding to each picture 320 to select a specific one or more pictures 320; the user can select the watermark position, for example, choose to add the watermark in the lower right corner, and then click "OK" to submit the selected original picture and watermark addition information to the system background. In addition, the user can also upload a watermark image. For example, clicking "OK" here will pop up the watermark image upload interface, or clicking the watermark processing button 220 before will pop up the watermark image upload interface, which is not specifically shown in the figure.
[0054] Through the watermark processing interface, the following advantages can be obtained in many aspects: in terms of processing flow, after the user edits the content, he can embed watermarks in batches for the images in the currently edited content. The corresponding images and the method of adding watermarks can be selected according to the needs, and the watermark embedding work can be completed in one go, which is very convenient; in terms of visualization, all the images in the edited content can be extracted and displayed on the watermark processing interface, realizing a more intuitive operation method; in terms of automation, the pasted content is automatically downloaded silently in the background, and the user is unaware of it. The user only needs to select the image to embed the watermark in the watermark processing interface; in terms of efficiency, multiple images can be embedded with watermarks at one time, which is highly efficient.
[0055] Figure 4 Shows the watermark embedding operation interface of the existing rich text editor, refer to Figure 4 As shown, the watermark embedding operation interface 410 of the existing rich text editor 400 displays simple text content in the form of a web page dialog box. In terms of processing flow: the user needs to add a watermark while editing the content. To complete the editing of a piece of content, it is necessary to switch back and forth between text editing and image uploading and watermark embedding operations many times, which is very cumbersome; in terms of visualization: uploaded images and watermarked images can only display the file path, and the content with images cannot be displayed due to the cache mechanism of the rich text editor; in terms of automation: the pasted content needs to manually download and re-upload the images and add the watermark, and there is no automated processing; in terms of efficiency: the efficiency of embedding watermarks for a single image each time is low.
[0056] It can be seen that when the user issues a watermark trigger operation, the present invention generates a watermark processing interface that displays all image contents and provides options for each image and watermark information based on the local image address that has been captured and downloaded. The user can flexibly select images that need to be watermarked, watermark adding locations and other information according to scene requirements through the watermark processing interface, and submit them in batches to the background. The operation process is intuitive, convenient, flexible and controllable.
[0057] Step S130, according to the original image and watermark adding information selected in the watermark processing interface, watermark embedding processing is performed on the original image, and graphic content containing the target image embedded with the watermark is generated in the rich text editor.
[0058] The watermark adding information includes the watermark position and the watermark image; according to the original image selected in the watermark processing interface and the watermark adding information, the watermark embedding processing of the original image is performed, specifically including: the rich text editor submits the original image selected in the watermark processing interface, the watermark adding information and the current editing content to the server; the server embeds the watermark image at the watermark position of the original image, generates a target image embedded with the watermark, and replaces the local image address of the original image with the local image address of the target image to generate a second updated editing content, and returns to the rich text editor.
[0059] After the server obtains the original image, watermark image information and watermark location information, it can batch embed the original images that need to be watermarked by creating a task queue. After the image watermark is embedded, the image access address with the watermark is replaced in the original HTML text, that is, the first updated edit content mentioned above, and then the new HTML content, that is, the second updated edit content, is returned to the rich text editor. The rich text editor calls the content setting method to reset the page content, achieve the effect of partial refresh, and display the graphic content that has been embedded with the watermark image in batches.
[0060] The server can use professional image processing tools such as ImageMagick to batch embed image watermarks. The server provides a watermark processing interface, receives data such as the original image, watermark image, watermark position, and HTML text selected by the user, and calls the ImageMagick tool to traverse and batch embed the watermark images into the specified positions of the specified original images to generate the target image. The original image can be retained for use when the user cancels the watermark.
[0061] This step can perform image watermark embedding processing in batches based on the images and watermark information selected by the user, generate graphic content containing the target images with watermarks added and display them in the rich text editor, and complete the processing of different watermark embedding requirements in a complex environment in one step, effectively improving the efficiency of image watermark embedding and the practicality of the image watermark processing function of the rich text editor.
[0062] Figure 5 The main steps of a method for processing image watermarks based on a rich text editor in a specific example are shown. This example mainly describes the innovation compared with the existing process, and the features and principles of image watermark processing described in the above embodiments are not repeated.
[0063] S510, user 500a pastes content in rich text editor 500b, then rich text editor 500b monitors the paste event and submits the pasted content to the backend, namely, system backend 500c.
[0064] S520, the system background 500c parses the pasted content, automatically grabs the external domain name image, and downloads it to the local server to facilitate subsequent processing of the image.
[0065] S530, the system background 500c replaces the local image address with the original content, that is, replaces the external image address in the pasted content with the local image address, and returns it to the rich text editor 500b to reset the content, that is, the rich text editor 500b refreshes the current editing content.
[0066] S540, the user 500a clicks the embed watermark button, and the rich text editor 500b extracts all the localized stored image addresses to render the images and generates a watermark processing visualization interface JS.
[0067] S550, the rich text editor 500b renders and displays a visual interface. The custom components of the rich text editor 500b are used to arrange and display all the pictures. Through the visual interface, the user can perform operations such as selecting and deselecting pictures and selecting watermark positions.
[0068] S560, the user 500a selects multiple images and watermark processing methods, including watermark location information, watermark image information, etc. The rich text editor 500b submits the user selected content and the current editing content to the backend for processing.
[0069] S570, the system background 500c uses ImageMagic to embed watermarks in batches, and can create a task queue to process the pictures that need to be embedded with watermarks.
[0070] S580, the system backend 500c replaces the watermark image address with the original content, that is, replaces the relevant image address in the current editing content with the image address after watermark processing, and returns it to the rich text editor 500b to reset the content. Thus, the image content embedded with the watermark is transmitted back to the front end, so that the rich text editor 500b refreshes the content and displays the graphic content embedded with the watermark image.
[0071] Figure 6The main system modules of a picture watermark processing method based on a rich text editor in a specific example are shown. This example mainly describes the innovation compared with the existing system modules, and the features and principles of picture watermark processing described in the above embodiments are not repeated.
[0072] The rich text editor 610 is configured with: a custom component 611, which provides a custom "add picture" function and is embedded in the toolbar of the rich text editor 600a; a content paste monitoring module 612, which is used to monitor the user's content pasting event and submit the editor content to the system background for parsing and processing when triggered; a picture address management module 613, which is used to manage the extraction of all picture addresses and dynamically generate view content for watermark management; a watermark management visualization module 614, which is used to provide options such as picture list display, whether to add watermarks to each picture, watermark content, and adding location; an HTML content write-back refresh module 615, which is used to receive the HTML content that replaces the watermark picture address in the background and set it to the editor and partially refresh the display.
[0073] The system backend 620 is configured with: a picture grabbing and downloading module 621, which is used to determine whether it is a picture of this system, and download the external system picture to this system through an external link; a picture processing task module 622, which is used to create and manage picture grabbing and downloading tasks and embedding picture watermark tasks, and schedule related task execution modules; an ImageMagic image processing tool 623, which is used to embed watermarks into pictures; a message queue 624, which is used to save picture task processing data and ensure task queuing processing; a file server 625, which is used to store pictures uploaded by users, pictures grabbed and downloaded by the system, pictures newly generated by embedding watermarks, and provide access to picture resources; an HTML parsing module 626, which is used to receive HTML content submitted by the rich text editor 610, parse the content to obtain all picture addresses, replace the watermark picture addresses to generate new HTML content and return. Of course, the settings of the system modules are not limited to Figure 6 As shown, different system modules can be merged, or the same system module can be disassembled, as long as the image can be visually, conveniently and flexibly embedded / cancelled in batches based on a rich text editor.
[0074] Figure 7 The main data flow process of the image watermark processing method based on a rich text editor in a specific example is shown. This example mainly describes the innovation compared with the existing data flow process, and the features and principles of the image watermark processing described in the above embodiments are not repeated.
[0075] Data input step S710: User 700a inputs business data into rich text editor 700b. This step can be done by pasting, that is, rich text editor 700b can process the pasted data content, while the traditional method can only process the images uploaded by uploading.
[0076] Submission step S720: the rich text editor 700b submits the input data to the system background 700c.
[0077] Download and capture step S730: the system backend 700c downloads the image from the third-party website 700d. This step can realize automatic downloading of external images, which is more efficient than the traditional manual download and upload method. Of course, in the present invention, the user 700a can also directly upload the image to the system backend 700c, which is not specifically shown in the figure.
[0078] Picture storage / calling step S740: the system background 700c saves the downloaded picture to the local file server 700e for subsequent calling processing.
[0079] Return step S750: the system backend 700c returns the content with the image address replaced to the rich text editor 700b.
[0080] Data display step S760: the rich text editor 700b refreshes the currently displayed data according to the updated content. Here, the rich text editor 700b can also return to the dynamic watermark processing interface according to the watermark trigger data input by the user, and display all the pictures and related operation elements in the edited content, while the traditional method returns a static interface and cannot display the picture content.
[0081] Next, data input step S710 ′: the user inputs watermark processing data into the rich text editor 700 b .
[0082] Submission step S720': the rich text editor 700b submits the input data to the system background 700c. The present invention submits multiple watermark embedding service data without uploading image data. The traditional method can only submit one watermark embedding service data at a time, and the image data must be uploaded at the same time, which consumes a lot of time each time.
[0083] Create image processing task step S770: the system background 700c assigns the image processing task module 700f to perform image watermark processing according to the business scenario.
[0084] Calling image processing tool step S780: the picture processing task module 700f calls the ImageMagic tool 700g to perform batch processing of picture watermarks.
[0085] Generate watermark embedded picture saving step S790: ImageMagic tool 700g saves the picture with embedded watermark to file server 700e.
[0086] Return step S750': the system backend 700c retrieves the watermarked image from the file server 700e and returns it to the rich text editor 700b. The present invention returns the full text HTML content after the batch image watermark is embedded, which is easier to process than the traditional method of returning only the watermark image address.
[0087] Data display step S760 ′: the rich text editor 700b refreshes the content to provide data display to the user.
[0088] The image watermark processing methods of the above-mentioned embodiments realize the image watermark batch embedding function of the rich text editor. Compared with the prior art, watermarks can only be embedded on one uploaded image at a time, and batch processing is not possible, which seriously affects the production efficiency of editing content. The present invention automatically downloads external system images, combines all images in the editor content to generate a dynamic image watermark batch embedding view, and solves the core problem that the updated content cannot be displayed due to the strong caching mechanism of the editor. It provides users with a feature-rich visual image watermark batch embedding method based on a rich text editor, which completes the needs of multiple image embedding watermark scenarios in one step, thereby improving the work efficiency of watermark processing.
[0089] Further, based on any of the above embodiments, the image watermark processing method also includes: canceling the watermark of the target image according to the selected target image and watermark deletion information in the watermark processing interface, and generating graphic content containing the original image with the watermark canceled in the rich text editor. Among them, canceling the watermark of the target image according to the selected target image and watermark deletion information in the watermark processing interface specifically includes: the rich text editor submits the target image selected in the watermark processing interface, the watermark cancellation information and the current editing content to the server; the server replaces the local image address of the target image with the local image address of the original image corresponding to the target image to generate the third updated editing content, and returns it to the rich text editor.
[0090] Can be combined Figure 3 As shown, when the user selects several target images that have been embedded with watermarks in the watermark processing interface 310, and selects "Cancel watermark" in the "Select watermark position or cancel watermark" interactive control, the watermark cancellation operation for the target images can be performed in batches. The specific operation principle can be found in the description of any of the above embodiments, and will not be repeated here.
[0091] In summary, the image watermark processing method based on the rich text editor of the present invention, through automatic image capture, adding a custom image watermark embedding tool, and extracting all images in the content to dynamically generate a visual watermark processing interface, allows users to complete the watermark embedding processing of all images in the edited content in one step, enriches the functions of the rich text editor, reduces user operation steps, and improves the efficiency of image watermark embedding. Different from the way other editors implement image watermark embedding, this method extracts all images in the edited content and displays them in a list, so that users can set different watermark embedding schemes for each image, including whether to embed a watermark, select watermark content, and the location of the embedded watermark, etc. After setting, it is uniformly submitted to the background for processing, and the final content is returned to the front end for local refresh display at one time, and the work of processing user embedded watermarks is extracted as the last unified processing step of content editing, and a visual interactive capability is provided, and the processing method is more flexible, humane and efficient. In addition, since the present invention lists and displays all the images in the editor content one by one, they can be processed in a targeted manner, and the image embedded with a watermark will retain the original image. Therefore, the method of the present invention can provide an operation to cancel the watermark. The user can directly select the image to which the watermark has been added to set the watermark cancellation. The background can replace the original image according to the instruction to achieve the effect of canceling the embedded watermark. There is no need for the user to delete the watermark image and then re-upload it as in the existing implementation method.
[0092] The embodiment of the present invention also provides a picture watermark processing device, which can be used to implement the picture watermark processing method described in any of the above embodiments. The features and principles of the picture watermark processing method described in any of the above embodiments can be applied to the following picture watermark processing device embodiments. In the following picture watermark processing device embodiments, the features and principles of picture watermark processing that have been explained will not be repeated.
[0093] Figure 8 The main modules of the image watermark processing device based on the rich text editor in one embodiment are shown, referring to Figure 8 As shown, the image watermark processing device 800 based on the rich text editor in this embodiment includes: an image local storage module 810, which is used to obtain the editing content of the rich text editor, locally store all images in the editing content, and generate a local image address; a visual interface generation module 820, which is used to respond to the watermark trigger operation and generate a watermark processing interface in the rich text editor that displays all images and each image and watermark information is available for selection according to the local image address; an image watermark processing module 830, which is used to perform watermark embedding processing on the original image according to the original image and watermark addition information selected in the watermark processing interface, and generate graphic content containing the target image embedded with the watermark in the rich text editor.
[0094] Furthermore, the image watermark processing device 800 may also include modules for implementing other process steps of the above-mentioned embodiments of the image watermark processing method, for example, Figure 6 The various system modules shown in the figure can be combined with different system modules, or the same system module can be disassembled, as long as it can realize the visual, convenient and flexible batch watermark embedding / cancellation processing of images based on the rich text editor. The specific principles of each module can refer to the description of the above-mentioned picture watermark processing method embodiments, and will not be repeated here.
[0095] The image watermark processing device of the present invention can display all images in the content of a rich text editor to the user. The user can uniformly select images that need to be embedded with watermarks and the watermark information that needs to be embedded before submitting for publication after completing all image and text editing work such as uploading, pasting, and content typesetting. The watermarks are embedded in batches in the background and then replaced in the original text, so that the processing work of different watermark embedding requirements in a complex environment is completed in one step. The use process is more intuitive, convenient, flexible and controllable, which effectively improves the efficiency of image watermark processing and improves the practicality of the image watermark processing function of the rich text editor.
[0096] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.
Claims
1. A method for processing image watermarks based on a rich text editor, characterized in that: include: Obtain the edited content of the rich text editor, locally store all images in the edited content, and generate a local image address; In response to a watermark triggering operation, generating a watermark processing interface in the rich text editor according to the local picture address, displaying all the pictures and providing each picture and watermark information for selection; According to the original image and watermark adding information selected in the watermark processing interface, watermark embedding processing is performed on the original image, and graphic content containing the target image embedded with the watermark is generated in the rich text editor.
2. The image watermark processing method according to claim 1, characterized in that: The editing content includes pasted content, and obtaining the editing content of the rich text editor includes: The rich text editor monitors content paste events; When the content paste event is monitored, the rich text editor obtains the pasted content of the content paste event and submits it to the server.
3. The image watermark processing method according to claim 2, characterized in that: The localizing and storing all the pictures in the edited content to generate local picture addresses includes: The server parses the edited content, identifies the image tag in the edited content, and obtains the image address according to the image tag; Determine whether there is an external picture address in the picture address; If so, the server fetches and downloads the image according to the external image address, generates a local image address, and replaces the external image address with the local image address to generate the first updated editing content, and returns to the rich text editor.
4. The image watermark processing method according to claim 3, characterized in that: After returning to the rich text editor, the method further includes: The rich text editor extracts all local image addresses in the first updated edited content based on a regular expression and stores them in an array; When the rich text editor responds to the watermark trigger operation, it obtains the local image address by calling the array.
5. The image watermark processing method according to claim 1, characterized in that: The rich text editor is configured with a watermark processing button, and the watermark processing button is added to the toolbar of the rich text editor by modifying the source code or configuration file of the rich text editor; When the watermark processing button is triggered, the watermark triggering operation is generated.
6. The image watermark processing method according to claim 1, characterized in that: The step of generating a watermark processing interface in the rich text editor according to the local picture address, displaying all the pictures and providing each picture and watermark information for selection, comprises: The rich text editor obtains the local image address to render the image, and generates a watermark processing interface that lists all the images. The watermark processing interface is configured with interactive controls for selecting each image and watermark information.
7. The image watermark processing method according to claim 1, characterized in that: The watermark adding information includes the watermark position and the watermark image; The watermark embedding process of the original image is performed according to the original image and the watermark adding information selected in the watermark processing interface, including: The rich text editor submits the original image selected in the watermark processing interface, the watermark adding information and the current editing content to the server; The server embeds the watermark image at the watermark position of the original image to generate a target image embedded with the watermark, and replaces the local image address of the original image with the local image address of the target image to generate a second updated editing content, and returns it to the rich text editor.
8. The image watermark processing method according to claim 1, characterized in that: Also includes: According to the selected target image and watermark deletion information in the watermark processing interface, the watermark cancellation processing of the target image is performed, and the graphic content containing the original image with the watermark cancelled is generated in the rich text editor.
9. The image watermark processing method according to claim 8, characterized in that: The process of performing watermark cancellation processing on the target image according to the selected target image and the watermark deletion information on the watermark processing interface includes: The rich text editor submits the target image selected in the watermark processing interface, the watermark cancellation information and the current editing content to the server; The server replaces the local image address of the target image with the local image address of the original image corresponding to the target image to generate a third updated edited content, and returns it to the rich text editor.
10. A picture watermark processing device based on a rich text editor, characterized in that: include: The picture local storage module is used to obtain the edited content of the rich text editor, locally store all pictures in the edited content, and generate a local picture address; A visual interface generation module, for responding to a watermark trigger operation, generating a watermark processing interface in the rich text editor according to the local picture address, displaying all the pictures and providing options for each picture and watermark information; The picture watermark processing module is used to perform watermark embedding processing on the original picture according to the original picture and watermark adding information selected in the watermark processing interface, and generate graphic content containing the target picture embedded with the watermark in the rich text editor.
Citation Information
Patent Citations
Systems and methods for adding watermarks using an embedded browser
CA3096532A1
Picture processing method and device
CN104835105A
