Topic on Project:Support desk

How to display only part of an image

5
Xelgen (talkcontribs)

Hi folks,

Is there a way to display just small, defined area of image using MediaWiki's [[Image:]]?

Let's say you have a scan of book page, and you want to show only illustration on that page, without showing whole scanned page (with text, etc..). Speaking more techicaly let's say we have image of 1000x800px and you want to display only a small part of it starting from possition 200,50 and with height width, 100 and 300.

Is it currently possible? Or planned in near future? I guess this will be very useful, especially for Wikisource.

I've googled for a while, and looked thorugh MedaWiki manuals, but didn't find an answer. I understand that currently there's no way to make it using only HTML <img> tag, but this can be done, using block elements, or displaying image as background.

Thanks beforehad,

MarkAHershberger (talkcontribs)

You could probably do something with jcrop.

Xelgen (talkcontribs)

Yes, that's what I'm using now. But JCrop is good for making a crop selection, and after that we have to crop it on 3rd party server, and upload a new cropped version of files back to wiki.

What I meant, was to use something in native MediaWiki Syntax, e.g. [[Image:Book_page_scan1|crop=X1,Y1,X2,Y2|thumb|this image shows only portion of page with X1, Y1 topleft corner, and X2, Y2 bottom right corner]] without having to upload new file, and just using what we already have.

You can probably do something like this with Divs and templates, but then image will be div's background, and won't behave the way regular images do.

But in the end of the day, visitors will have to load full image, to see just small part of it, and as I wanted to use it for few thousands images, on hopefully popular pages, I guess cropping and uploading new cropped images, is the way to go.

Thanks for your response.

Dabed (talkcontribs)

I want the same but although this question is more than 11 years old I guess there is still no way to do it or did you learn how?

Wmyttmlimvty (talkcontribs)

Same here!

Reply to "How to display only part of an image"