Phần mở rộng:ImageCompare
This extension is incompatible with MediaWiki 1.38 or any later release! You are advised against using this extension on a live site. Volunteer developers are invited to pledge their efforts to updating this extension to make it compatible with MediaWiki 1.39 by replacing the {{Incompatible }} template with {{Incompatible |version=1.38|pledge=~~~~}} . |
This extension is currently not actively maintained! Although it may still work, any bug reports or feature requests will more than likely be ignored. If you are interested in taking on the task of developing and maintaining this extension, you can request repository ownership. As a courtesy, you may want to contact the author. You should also remove this template and list yourself as maintaining the extension in the page's {{extension}} infobox. |
![]() Trạng thái phát hành: unmaintained |
|
---|---|
![]() |
|
Cài đặt | Tag |
Mô tả | Thêm một thẻ để so sánh hai hình ảnh với một thanh trượt trực quan |
Tác giả | Leduyquang03thảo luận |
Phiên bản | 0.0.3 (2018-12-11) |
MediaWiki | 1.29+ |
PHP | Any |
Database changes | Không |
Giấy phép | MIT License |
Tải xuống | |
imgcomp |
|
Quarterly downloads | 5 (Ranked 171st) |
Translate the ImageCompare extension if it is available at translatewiki.net | |
Issues | Open tasks · Báo cáo lỗi |
Phần mở rộng này thêm thẻ <imgcomp>
, nó sẽ hiển thị một thanh trượt tương tác trực quan trong việc so sánh hai hình ảnh với nhau.
Cài đặt
- Download and place the file(s) in a directory called
ImageCompare
in yourextensions/
folder. - Thêm mã sau vào dưới cùng tệp $LocalSettings của bạn:
wfLoadExtension( 'ImageCompare' );
- Xong – Chuyển tới Special:Version trên wiki của bạn để xác nhận phần mở rộng được cài đặt thành công.
Cách dùng
Để thêm hai hình ảnh vào so sánh, dùng thẻ <imgcomp>
với các thuộc tính sau (các tên in đậm là bắt buộc phải có):
- img1: Tiêu đề hình ảnh bên trái ("trước").
- img2: Tiêu đề hình ảnh bên phải ("sau").
- width: Một con số chỉ định chiều rộng của hai hình ảnh, tính bằng pixel. Theo mặc định, các hình ảnh được thêm vào với độ phân giải cao nhất có thể.
- mobilewidth: A number specifying the width of the images for the mobile version, also in pixels. If not specified, it will be 320 or the specified width if it is smaller.
Các tiêu đề không được có vùng tên File:. Nội dung bên trong thẻ sẽ bị bỏ qua.
Tốt nhất, hai hình ảnh được so sánh nên có chiều cao và chiều rộng bằng nhau.
- Ví dụ
Để so sánh JPEG example.jpg với PNG example.png:
<imgcomp img1='JPEG example.jpg' img2='PNG example.png' />
Để so sánh Draft.png với Colored.png, mỗi hình ảnh có chiều rộng 400 điểm ảnh:
<imgcomp img1='Draft.png' img2='Colored.png' width=400 />