How to adjust the cropping or scaling of thumbnails without changing their size?

Calendar 👁️ 96

In website content operation, images play a crucial role, especially thumbnails, which are often the first impression visitors have of the content.A suitable thumbnail can not only attract clicks, but also enhance the visual appeal and professionalism of the entire page.AnQi CMS knows this and provides us with flexible thumbnail processing functions.

Sometimes, we may not want to change the fixed display size of thumbnails - for example, our website design requires all thumbnail images on list pages to be 120x120 pixels, but we find that some images are stretched or cropped in a way that is not satisfactory.Now, our need is not to change the size, but to adjust the system to how the original image is 'stuffed' into this fixed thumbnail size frame.

How can you adjust the cropping or scaling of the thumbnail without changing its predetermined size?AnQi CMS provides very intuitive settings to help us achieve this goal.

Position the thumbnail processing settings

First, we need to log in to the Anqi CMS backend management interface. Find and click on it in the left menu.“Background Settings”and then select"Content Settings"Here is a collection of various global configurations related to the website content, including the thumbnail processing options we are concerned about.

Specify the thumbnail size.

In the "Content Settings" page, you will see a name called“Thumbnail size”The option.Here, the unified width and height of your website thumbnails are usually set, for example, '200x150'.Remember, this time our goal is to keep the size unchanged, just adjust the way the image fits into this size frame.So, we don't need to change the value here.

Adjust the thumbnail processing method

The real core lies in“Thumbnail processing method”This option. Anqi CMS provides three mainstream and practical processing methods here, each with its unique performance effect:

  1. Scale proportionally to the longest sideThis is the most 'gentle' scaling method. The system scales the original image proportionally based on the longest side until that side matches the longest side of the thumbnail frame. The advantage of this isThe image content will be retained in full, it will not be cropped.However, the缺点is also very obvious, if the aspect ratio of the original image is not consistent with the thumbnail frame, then there may be blank space on one side (width or height) of the thumbnail.For example, a 16:9 wide-screen image placed into a 1:1 square thumbnail frame may have blank spaces at the top and bottom.

  2. Fill the longest sideIf you want the image to be displayed completely, while maintaining a fixed thumbnail size, and not having any uncertain blank space, then 'Fill to the longest edge' would be the ideal choice. The system will first resize the image proportionally to the longest edge, ensuring that the image is displayed completely within the thumbnail frame, and then fill the excess part of the thumbnail frame (usually the edges) withSolid white blockFilling. In this way, you can ensure that the image is complete and obtain a fixed size, visually neat thumbnail.

  3. Trim according to the shortest edgeIf you pursue visual consistency and neatness for thumbnails and are not bothered by sacrificing part of the image content at the edges, then 'crop by the shortest side' comes in handy.The system will use the shortest edge of the original image as a reference, scaling it proportionally until that edge matches the shortest edge of the thumbnail frame.Centered croppingMake sure the thumbnail frame is completely filled with the image, leaving no blank space.This method is most commonly used in scenarios where a strict unified visual style is required for product lists, avatars, etc.It ensures that all thumbnails are perfectly filled to the specified size, but may crop some of the original image edges.

Make the changes take effect: batch regenerate thumbnails.

After selecting your favorite thumbnail processing method, an important step is to make these settings effective for your websitethe existing imageseffective. At the bottom of the "Content Settings" page, you will find a“Batch regenerate thumbnails”function.

Click this button, Anqi CMS will regenerate thumbnails for all uploaded images on the website according to your latest settings.This process may take some time, depending on the number of images on your website.After the operation is complete, you will visit the website front end again and find that the thumbnails have been displayed according to the new cropping or scaling rules.For new images uploaded thereafter, the system will also automatically process them according to the current settings.

Summary

By using the "Thumbnail Processing Method" option in the "Content Settings" of AnQi CMS, we can flexibly control the image adaptation strategy without modifying the thumbnail size.No matter whether you want to display images completely, fill the background, or uniformly crop, it can be easily achieved, making the visual presentation of the website more accurate and professional.


Frequently Asked Questions (FAQ)

Q1: Why did the pictures on the website not change after I modified the thumbnail processing method?A1: After changing the thumbnail processing method, you need to perform the 'batch regenerate thumbnails' operation on the uploaded images, the new settings will take effect on them.For new images uploaded later, the system will automatically apply the new processing method.

Q2: Can I set different thumbnail processing methods for different types of content (such as articles and products)?A2: The thumbnail processing method in the "Content Settings" is a unified setting across the entire site.This means it will be applied to all scenarios requiring thumbnail generation (such as article thumbnails, product thumbnails, etc.).If you need to display different styles for different content, you can consider uploading images with different styles, or performing more complex customization at the template level.

Q3: If I want to display the thumbnail centered while maintaining the size and cropping away the excess to fill the entire area, which method should I choose?A3: In this case, you should chooseCut according to the shortest sideIt ensures that the thumbnail completely fills the specified size, while also centering the original image and cropping off the excess content around the edges.

Related articles

In the `tag-thumb.md` example, how does `item.Logo` and `item.Alt` work with the `thumb` filter?

Managing and displaying images in AnQi CMS is an indispensable part of content operation, especially as the way images are displayed directly affects the loading speed and user experience of the website.When designing templates, the `item.Logo`, `item.Alt`, and `thumb` filters are key components in handling image display. ### Understanding the Role of Images in Content Firstly, we need to clarify what `item.Logo` and `item.Alt` represent.

2025-11-08

How to ensure that the thumbnails generated by the `thumb` filter are correctly cached and distributed on the CDN?

AnQi CMS provides us with a convenient and quick content management capability, among which the `thumb` filter is an excellent helper for generating thumbnails.In website operation, we all hope that images load quickly, the user experience is good, and it can effectively reduce the server load.To achieve these goals, it is particularly important to ensure that the thumbnails generated by the `thumb` filter are correctly cached and distributed on the content delivery network (CDN).

2025-11-08

Does AnQiCMS provide a feature to clean up old thumbnail files that are no longer used?

In a content management system, image resources, especially thumbnails, play an important role in ensuring the aesthetics and loading speed of the website.As the website content is continuously updated and iterated, some old thumbnail files that are no longer used may gradually accumulate, occupying storage space, and may even affect management efficiency to some extent.Does AnQiCMS provide a function to clean up these idle thumbnail files?Let's delve into the existing document.

2025-11-08

How will the `thumb` filter generate thumbnails when processing images with transparent backgrounds?

In website operation, image materials play a crucial role.The `thumb` filter of AnQi CMS handles images for us, especially bringing great convenience in generating thumbnails.However, when dealing with images with transparent backgrounds (such as PNG formatted Logos or icons), its behavior may confuse some users.Understand the working mechanism of the `thumb` filter, especially when combined with background settings, which can help us make better use of this feature.

2025-11-08

Does the `thumb` filter support adding custom parameters to the generated thumbnails, such as lazy-load image loaders?

In content operation, images play a crucial role, not only attracting readers but also effectively conveying information.To enhance website performance and user experience, it is particularly important to manage and display images properly, especially thumbnails.AnQiCMS as a system focusing on efficient content management also provides convenient features in image processing, including the `thumb` filter we are discussing today.

2025-11-08

In `help-setting-content.md`, which method is more suitable for displaying at a fixed size: 'Trim to the shortest edge' or 'Pad to the longest edge'?

In website operation, we often encounter the need to display images at fixed sizes, such as in product lists, article summaries, or Banner areas. In order to maintain the neatness of the page layout and visual consistency, images usually need to be displayed strictly according to the set width and height.AnQiCMS (AnQiCMS) provides two thumbnail processing methods in the content settings, 'Trim to shortest edge' and 'Fill to longest edge', aiming to help us meet this challenge.So, faced with a fixed-size display scenario, how should we choose?

2025-11-08

How to use the `thumb` filter to load smaller thumbnail sizes on mobile devices?

In today's mobile-first era, the loading speed of a website is crucial for user experience and search engine rankings.Images are an important part of web content, and their size directly affects page loading speed.Especially on mobile devices, smaller image sizes mean faster loading times, less data consumption, and thus better user experience.AnQiCMS (AnQiCMS) provides a very practical `thumb` filter that helps us easily load smaller thumbnail images on mobile devices.

2025-11-08

Is there a feature to filter images by size or type in the AnQiCMS image management?

In daily website operations, image management is undoubtedly a key link to improve efficiency and optimize user experience.Especially for content-rich sites, how to efficiently search, use, and manage image resources is a concern for every operator.AnQi CMS knows this and has given a lot of consideration to its image management function, striving to provide users with a simple and practical solution.Is there a feature to filter images based on size or type in AnQiCMS image management?

2025-11-08