前言介紹
- 這款 WordPress 外掛「thumbGen」是 2010-02-22 上架。
- 目前有 100 個安裝啟用數。
- 上一次更新是 2015-01-30,距離現在已有 3750 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 2.9.0 以上版本才可以安裝。
- 有 2 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
image | thumb | images | generator | thumbnail |
內容簡介
is is the URL of the original image. The second parameter represents the width of the generated thumbnail and the third parameter represents the height of the generated thumbnail. Additionally, this example includes additional_parameters, "effect=grayscale&halign=left&valign=top", which applies the grayscale effect and sets the horizontal and vertical alignment to left and top, respectively.
Another example:
$filename="example.jpg";
thumbGen("http://example.com/images/".$filename,300,200,"filename=mythumbnail.jpg&crop=true&rotate=90&background=transparent");
?>
In this example, the first parameter is the URL of the original image, the second parameter represents the width of the generated thumbnail and the third parameter represents the height of the generated thumbnail. Moreover, additional_parameters include "filename=mythumbnail.jpg&crop=true&rotate=90&background=transparent". This sets the newly created thumbnail's filename to "mythumbnail.jpg", crops the thumbnail, rotates it by 90 degrees and sets the background color to transparent.
This plugin is a useful tool for developers who need to generate and manipulate thumbnails with ease.
原文外掛簡介
This plugin is made for developers.
It creates a function named thumbGen() that allows to show any image in the specified size. Additionally you can specify values like crop, center, rotation and effects.
It saves all generated thumbs in a cache folder, so it won’t overload your server at all.
Usage
To use this function you just need to use this line code:
[image:] the URL of the original image you need to create a thumbnail from (needed).
[width:] the width you need for the generated thumbnail (default=0 – if not specified it gets the
proportional value from the specified height).
[height:] the height you need for the generated thumbnail (default=0 – if not specified it gets the proportional value from the specified width).
note: if you don’t specify the with AND height (or if you set both to 0), the image will be generated in the source size.
Additional parameters
[filename:] some people have troubles with duplicated names, so I’ve added this parameter for you to specify a new filename (or ID or something like that) in order to differentiate each file (if not set it will use the source filename).
[md5:] by default, the images are generated with an md5 encode filename. If you don’t want the generated file to have an encoded name set this to 0
[force:] force thumb creation, even if it already exists (default=0) (NOT RECOMENDED! – use it just for testing or debugging)
[crop:] if you want the thumbnail to be cropped (no image deformation) if the width and height are different from the original image, set this value as 1 or true. If you want the content of the thumbnail to be resized to fit the space (image deformation) set this to 0 or false (default=1).
[halign:] horizontal align of the croped image. You can set it to left, center or right (default=center)
[valign:] vertical align of the croped image. You can set it to top, center or bottom (default=center)
[effect:] you can apply two effects: grayscale and sephia
[rotate:] you can specify a rotation angle
[background:] hex color (like #ffffff) to apply on the background ONLY when you rotate the image. If you don’t want a color applied you can set this to transparent (default=transparent)
[return:] if set to 1 (or true) the image name will be returned instead of printed (default=0).
[preserveAnimation:] if set to 1 (or true) it will show animated gif’s with motion but without applying other parameters. Otherwise, it will show the first frame of the animated gif resized.
[quality:] you can chooos from 0 to 9, where 0 is the worst quality (lower file size) and 9 is the best (bigger file size). The default value is 7.
Examples of usage
In this example I will not explain detailed how this WordPress code works, but I will show this as an example of this plugin usage:
$post->ID,
'post_type' => 'attachment',
'numberposts' => 1,
'post_mime_type' => 'image'
);
$attachs = get_posts($args);
if ($attachs) {
$img=wp_get_attachment_image_src($attachs[0]->ID,'full');
}
if(!empty($img)){
?>
This example reads the first attached image of a post and save it’s information in a variable called $img. In the thumbGen function the first parameter is $img[0] and that’s the image URL. The second and third parameters are the width and height of the generated thumbnail we need. The rest of the parameters are defined in the string in the format parameter=value, concatenated with an &. the values not specified will use their default value.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「thumbGen」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.0 | 2.0 | 2.1 | 2.5 | 2.6 | 2.7 | 2.5.1 | 2.5.2 | 2.5.3 | 2.5.4 | 2.5.5 | 2.5.6 | 2.6.1 | 2.7.1 |
延伸相關外掛(你可能也想知道)
Image Optimization by Optimole – Lazy Load, CDN, Convert WebP & AVIF, Optimize Images 》, Optimole的獨特之處在哪裡?, , 更小的圖片,同樣的品質, 完全自動化;設定一次就忘記它, 支援所有圖片格式, 支援Retina和WebP圖片, 以機器學習為基礎的自...。
Imsanity 》使用 Imsanity,自動調整大型圖片上傳大小。選擇你喜歡的尺寸和品質,讓 Imsanity 完成其餘所有工作。當投稿者上傳大於配置尺寸的圖片時,Imsanity 將自動將...。
Firelight Lightbox 》Easy FancyBox WordPress外掛為您的網站提供靈活美觀的光箱解決方案,幾乎適用於網站上的所有媒體連結。Easy FancyBox使用更新的傳統FancyBox jQuery擴展版本...。
Simple Lightbox 》Simple Lightbox 是一個非常簡單且可自定義的燈箱,在您的 WordPress 網站上添加它非常容易。, 功能, 自定義燈箱行為的選項位於外觀 > Lightbox 管理員菜...。
Robin image optimizer — save money on image compression 》需要專業支援嗎?, 開始免費支援, 開始高級支援, 透過減少圖像大小,讓您的網站加快速度。我們的 WordPress 圖像優化外掛,可以將圖像大小減少80%,而且不損...。
Responsive Lightbox & Gallery 》提供完整的 WordPress 相簿外掛所需一切, Responsive Lightbox and Gallery 外掛是一個全功能的 WordPress 相簿外掛,擁有強大的拖放相簿生成器和 Lightbox ...。
reSmush.it : The original free image compressor and optimizer plugin 》reSmush.it Image Optimizer 是一個 WordPress 外掛,透過 reSmush.it API 提供圖片優化服務。reSmush.it 使用多種高級演算法對圖像進行大小減小。API 支援最...。
Menu Image, Icons made easy 》這個外掛可以輕鬆地在選單項目中加入圖像或圖示,打造更好的網站選單。, 可以控制圖像或圖示的位置以及大小。, 這個 Menu Image 外掛還有其他功能,以下是其...。
Image Widget 》Image Widget 是一個簡單的外掛程式,利用 WordPress 原生媒體管理員,為您的網站新增圖片小工具。, 需要新增幻燈片、燈箱或隨機圖像嗎?, 請查看 Image Widg...。
Featured Image from URL (FIFU) 》h3>WordPress 外掛 - 用於顯示外部特色圖片、影片、音訊等等, FIFU 自 2015 年來已幫助全球數千個網站節省了儲存空間、處理時間和版權費用。, 如果您已經厭倦...。
Default Featured Image 》在媒體設定頁面上新增一個預設的特色圖像。如果沒有設定任何特色圖像,這個預設的特色圖像就會顯示。就這麼簡單。, 查看常見問題以獲取基本問題資訊。, 如果...。
All In One Favicon 》查看最新的WordPress交易以優化您的網站。, All In One Favicon為您的網站和管理頁面添加favicon。, 您可以使用您已經上傳的favicon或使用內置的上傳機制將fa...。
ImageMagick Engine 》透過讓 WordPress 使用 ImageMagick 而非標準的 GD 圖像庫,大幅提升重新調整大小的圖像品質。, 功能, , 在重新調整大小的圖像中保留嵌入式色彩設定檔, 自動...。
WP Featherlight – A Simple jQuery Lightbox 》WP Featherlight 是一個 WordPress 外掛,可為您的WordPress 網站添加一個極簡、高效、響應式 jQuery 燈箱。在其核心,WP Featherlight是一個用於 Featherlig...。
Phoenix Media Rename 》通過使用「Phoenix Media Rename」外掛,將您的媒體檔案重新命名,極大地提高您的 SEO。, 在Phoenix Media Rename 官方頁面上提供了完整的使用和設置指南。。