How to control the automatic compression of large images and the generation of thumbnails in AnQiCMS?

Calendar 👁️ 62

In website operation, images play a crucial role.They are not only elements that attract users' attention, but also directly affect the website's loading speed, user experience, and even the performance of search engine optimization (SEO).Manage website images, especially the compression of large-sized images and the generation of thumbnails, is a key factor in improving website performance and aesthetics.AnQiCMS (AnQiCMS) fully understands this and provides flexible and powerful image processing functions in its content management system, allowing you to easily control the automatic compression of large images and the generation of thumbnails.

Why is image processing so important?

Imagine a website that loads slowly, often because it contains a large number of unoptimized images.Users may lose patience and directly close the page.Search engines also tend to prefer websites with fast loading speeds.Therefore, effectively managing images, including compressing large images to reduce file size and generating thumbnails of different sizes to adapt to different display scenarios, is crucial for improving the overall performance of the website.The AnQi CMS is designed to help users solve these pain points, providing a simple and efficient image processing solution.

Control the automatic compression of large images

To prevent users from uploading large images that cause the page to load slowly, AnQi CMS provides a feature to automatically compress large images.This setting can be found under the "Background Settings

In the 'Content Settings', you will see an option named 'Whether to automatically compress large images'.By default, this feature may be disabled.If you want the system to automatically process all large images uploaded, just enable it.Once enabled, the system will check the size of the image when it is uploaded and compress it according to the rules you set.

Right away, you will find the setting item 'Auto-compress to specified width'.Here you can define the maximum width of the large image after automatic compression.For example, the default value may be 800 pixels.This means that any image with a width exceeding 800 pixels will be automatically compressed after uploading, ensuring that the width does not exceed 800 pixels while maintaining the aspect ratio of the image.This feature is very practical because it can reduce the file size of the image while ensuring the visual effect of the image, thereby speeding up the loading speed of the web page and saving storage space.

The precise customization of thumbnail generation method

In addition to large image compression, thumbnail generation is another important feature that can significantly optimize the display of a website.The AnQi CMS not only supports automatic extraction and setting of thumbnails (for example, when you publish a document without manually uploading a thumbnail, the system will intelligently extract the first image from the article content as a thumbnail), but also provides various refined thumbnail processing methods to meet different design and display requirements.These settings are also located on the 'Content Settings' page.

  1. Thumbnail processing method:AnQi CMS provides three mainstream thumbnail generation algorithms:

    • Scale proportionally to the longest side:This is the most commonly used way.It will resize the image according to the thumbnail size you set, maintaining the original aspect ratio.This means that one side (length or width) of the thumbnail will match the set size, while the other side will be adjusted proportionally.The original content is preserved completely, without any cropping or white space.
    • Pad to the longest edge:If you need to fix the size of the thumbnails (for example, all thumbnails must be 150x150 pixels) and want the image content to be displayed completely, then 'pad to the longest side' would be the ideal choice.The system will resize the image proportionally to the closest size set, then fill the insufficient part with white (or other preset colors) to make the thumbnail reach the set fixed size, and display the image content centered.
    • Trim to the shortest edge:When you aim for all thumbnails to be perfectly filled to a fixed size and visually compact, you can choose to "crop to the shortest side".The system will center the image and then crop along the shortest edge until the image completely fills the specified size.This method may cut off part of the original image's edge content, but it can ensure that the thumbnail's height and width match the set values exactly.
  2. Thumbnail size:Here, you can specify the thumbnail size required for your website, for example, "200x150".The system will generate the corresponding image based on the thumbnail processing method you choose and this size.Setting the thumbnail size appropriately helps unify the visual style of the website layout and further optimize the image loading performance.

  3. Default thumbnail: This is a very considerate feature.If some content does not have a specific thumbnail, the system can automatically use the 'default thumbnail' you upload here for display.This ensures that even if the content lacks images, the page will not appear empty or with broken illustrations, enhancing the overall professionalism of the website.

  4. Batch regenerate thumbnails:During the operation, you may adjust the thumbnail size or processing method.This is when the 'Batch regenerate thumbnails' feature provided by Anqi CMS comes into play.Click this button, the system will reprocess all thumbnails on your website according to the latest settings, ensuring the consistency of the website image display.

Further optimization: WebP format and automatic extraction

The considerations of AnQi CMS in image processing are not limited to this.In the "Content Settings", you will also see the option to enable the Webp image format.WebP is a modern image format that can provide smaller file sizes at the same quality compared to traditional JPG and PNG.Enable this feature and new uploaded images will be automatically converted to WebP format, while the system also provides tools for batch conversion of existing images to further improve website performance.

At the same time, as previously mentioned, if no thumbnail is manually uploaded when you publish a document, the system will also intelligently extract the first image from the document content as a thumbnail.This reduces the steps of manual operation and improves the efficiency of content publishing.

Call images and thumbnails in the template

At the template design stage, you can easily call these processed images through the tags provided by Anqi CMS. For example, for document content, you usually can{{item.Logo}}Call the cover image of the document, pass{{item.Thumb}}Call the thumbnail. If you need to dynamically generate a thumbnail of a specific size based on the original large image (for example, a special size not set uniformly in the background), you can also utilizethumbFilter. Just pass the image URL in{{ image_url|thumb }}The system will dynamically generate the thumbnail address according to the preset rules in the background and display it on the page.

In summary, Anqi CMS has well-designed and practical features for image management, whether you are pursuing the ultimate website loading speed or hoping to have a unified and beautiful visual presentation, these tools can provide you with strong support.By making reasonable use of these features, you can make the website's image content management easier and more efficient.


Frequently Asked Questions (FAQ)

1. Have I already optimized the image, and do I need to enable the automatic compression of large images in AnQi CMS?Answer: It depends on whether the optimized image you have pre-optimized meets the actual display requirements of your website.If the image you upload is already small and of moderate size, you can choose not to enable automatic compression to maintain the original quality of the image.But if your image sources are diverse and you cannot guarantee that each one is strictly optimized, then enabling the automatic compression feature can act as a safety net to ensure that even if there are images uploaded without optimization, it will not have a significant impact on website performance.

2. Does AnqCMS support setting different thumbnail sizes and processing methods for different content models (such as articles and products)?Answer: In the current content settings of Anqi CMS, the thumbnail size and processing method are global settings that apply to all document model thumbnails. If you need to display thumbnails of different sizes for different content models (or different page areas), you can do so through the template bythumbA filter that takes the corresponding image URL to dynamically request the generation of thumbnails in specific sizes. This way, even if the background global settings are unified, the front-end display can be flexible and diverse.

3. Will the previously uploaded images be updated immediately if I change the thumbnail processing method or size?Answer: Changing the thumbnail processing method or size will immediately take effect on the images uploaded after that.The images that have already been uploaded will not be updated immediately.You need to go to the "Content Settings

Related articles

How does AnQiCMS automatically convert images to WebP format to speed up front-end loading?

In today's internet environment where content is exploding, the loading speed of a website is crucial for user experience and search engine rankings.Images are an important component of web content, and their loading performance is often a key factor affecting overall speed.AnQiCMS (AnQiCMS) understands this and provides the function of automatically converting images to WebP format, aimed at helping users effectively improve the front-end loading speed of websites.

2025-11-08

How to configure the image watermark feature in AnQiCMS to protect the display of original content?

Today, with content creation becoming increasingly important, how to effectively protect the copyright of original images and prevent unauthorized use has become a focus for many website operators.AnQiCMS (AnQiCMS) fully understands this need, built-in image watermarking function, helps us easily add exclusive marks to images, thus effectively maintaining their exclusivity while displaying original content. Next, we will learn together how to configure the image watermark feature in AnQiCMS, adding a solid protective barrier to your visual content.###

2025-11-08

How to set up and display the multi-language switch link in AnQiCMS?

Today, with the increasing popularity of globalization, website multilingual support has become a key to expanding the international market and serving a diverse group of users.AnQiCMS fully considered this requirement, providing flexible multi-language settings and switching functions, allowing the website to easily provide localized content experiences for users of different languages.This article will introduce in detail how to set and display the multi-language switch link in AnQiCMS, and discuss the relevant practical strategies.--- ### Understand the multi-language mechanism of AnQiCMS In AnQiCMS

2025-11-08

How to display breadcrumb navigation in AnQiCMS template to optimize user experience?

Have you ever felt lost while browsing a website?On an information-rich website, users sometimes feel overwhelmed, not knowing their current location, and it is also difficult to quickly backtrack to the upper page.This Breadcrumb Navigation is like a guiding light, providing clear path guidance and greatly optimizing their website experience.Breadcrumb navigation is usually displayed in the form of "Home > Category > Subcategory > Current Page", which can help users clearly understand their position in the website structure

2025-11-08

How to display custom contact information on AnQiCMS (such as WhatsApp, Facebook links)?

In today's digital age, a website is not just a platform for displaying information, but also an important bridge for businesses to connect with customers.Provide a variety of contact methods, such as WhatsApp, Facebook links, which can greatly enhance user experience and conversion efficiency.AnQiCMS as a powerful content management system provides a flexible and convenient solution in this regard.This article will introduce in detail how to set and display custom contact information in AnQiCMS, ensuring that your website can communicate with potential customers in the most convenient way.

2025-11-08

How to safely output rich text content in AnQiCMS templates and avoid XSS attacks?

When building and operating a website, content display is undoubtedly the core link.Especially when displaying rich text content that includes images, links, bold, italic, and other formats, how to ensure that the page is beautiful while also effectively resisting potential security threats is a problem worth in-depth discussion.AnQiCMS (AnQiCMS) is a content management system that emphasizes security and efficiency, providing clear and strong mechanisms in this aspect.

2025-11-08

How to use the 'loop iteration tag (for)' to display a dynamic data list in the template in AnQiCMS?

The website content needs to be continuously updated, such as displaying the latest articles, products, user comments, or navigation menus, and this dynamic data is often presented in the form of lists.In AnQi CMS, by using its powerful template engine and the intuitive 'loop traversal tag (for)', we can easily display these background data on the website front-end, making your website vibrant.The AnQi CMS template engine draws on the simplicity and efficiency of Django template syntax, making it easy for even developers who are new to the field to get started quickly. Among them

2025-11-08

How to use the 'if logical judgment tag' in AnQiCMS template to control the conditional display of content?

## Flexible use of the "if" tag in AnQiCMS template to achieve accurate content presentation In website content management, we often need to display different content based on different conditions, such as displaying a prompt in a specific situation, displaying different information based on the user's identity, or only rendering a specific block when certain data exists. The AnQiCMS template system provides us with a powerful and easy-to-use "if logical judgment tag" that helps us easily achieve these dynamic content display needs

2025-11-08