Jump to content

Commons talk:CropTool

From Wikimedia Commons, the free media repository
This is the talk page for discussing improvements to Commons:CropTool.
Archives: 1, 2, 3, 4
Notice Maintenance notice
Maintenance for this tool is at https://github.com/danmichaelo/croptool - please do not report bugs in Phabricator tasks. You can see the last edit it tagged here.

Lossless mode no longer working?

[edit]

@Danmichaelo, is lossless mode still working. I used to get messages that the crop size had been adjusted because I wasn't starting on a multiple of 8 or 16, but this has gone away. Similarly, there's a bug report on github (#170) reporting that files that should be uncroppable in lossless mode are now working, but produce the same files as if they were in precise mode. Is the tool silently falling back to precise when lossless doesn't work (which would be undesirable), or is something else going on here? Perhaps a bug introduced in the September 2020 refactoring? Ahecht (TALK
PAGE
) 14:59, 15 June 2022 (UTC)[reply]

Looking into the code more, it seems like the September 2020 refactor fundamentally broke things. The various types of crop were broken out into subclasses (for example, lossless Jpeg cropping was broken out into JpegFile and Gif cropping to GifFile), but as far as I can tell the only subclasses that are actually being called out by the program in FileRepository.php are TiffFile, DjvuFile, PdfFile, and SvgFile, all of which return errors instead of actually working. All other file types are being handled by the generic imagemagick call in File.php.
This is why lossless crops are no longer lossless, Gif files say they are being cropped with precise or lossless mode instead of "gif mode", and TIFFs, PDFs, and DJVUs no longer work.
If these issues aren't easy to resolve, perhaps to the tool should be rolled back to 1.4 (before the refactoring). Ahecht (TALK
PAGE
) 14:18, 17 June 2022 (UTC)[reply]
just confirming this issue persists 2023-01.--RZuo (talk) 11:53, 15 January 2023 (UTC)[reply]
Since about 9-2021 Danmichaelo's only contributions have been edits to wikidata and some edits in norwegian and finnish wikipedia about some meta-topics (bot problems, ...). I seem to remember that them was unhappy with a decission at english wikipedia. That leaves two ways of action: Appease them to return to wikipedia, or find a new maintainer for croptool. Just waiting woll not help. C.Suthorn (talk) 15:34, 15 January 2023 (UTC)[reply]
sigh :/
there were a few commits https://github.com/danmichaelo/croptool/commits/master .
i know someone might have to take over, but i reposted this thread because this is a major issue which should not be archived until it's resolved. RZuo (talk) 18:25, 15 January 2023 (UTC)[reply]
Bumping thread Ahecht (TALK
PAGE
) 19:19, 16 February 2024 (UTC)
[reply]
i think, with https://github.com/danmichaelo/croptool/pull/182 merged 2 days ago, lossless mode has now returned. i just tried previewing random crops in lossless mode and they were now being augmented to the left and the top again.
thx a lot @Danmichaelo, @Christoph Jauera (WMDE) and @TMg! RZuo (talk) 14:35, 20 February 2024 (UTC)[reply]
User:Danmichaelo Crop from .svg files still not working. Was this supposed to fix it? Doc James (talk · contribs · email) 15:34, 23 April 2024 (UTC)[reply]
Trying to crop File:Johnson and Johnson Marketing Ad Kilmer Opera House Pharmacy 1888.jpg went [Error] undefined when using lossless mode. Had to use precise mode. - Alexis Jazz ping plz 11:43, 11 January 2025 (UTC)[reply]

"Enter the URL or filename for an image you would like to crop."

[edit]

Intermittently in the past few days, I am seeing the message above when I try to use the CropTool from a Commons file page. I have entered the "URL" as well as the "filename" for the Commons image, but nothing happens. In the recent past, the CropTool performs normally again after an unknown period of time.

  • Can this intermittent issue be resolved?
  • What is the cause of this issue?

Thanks, --Ooligan (talk) 18:36, 11 March 2024 (UTC)[reply]

Just a remark: if you use the back button, then try the CropTool again, it is usually OK. - Jmabel ! talk 22:54, 11 March 2024 (UTC)[reply]
I will try that. Thanks --Ooligan (talk) 05:33, 12 March 2024 (UTC)[reply]
I have the same problem. Are we loosing another piece of this tool?
Funnily it even offers a hint: "Tip: You can open CropTool directly from a media file. Learn more at Commons." Enhancing999 (talk) 21:20, 17 March 2024 (UTC)[reply]
Up till today, the back button and try again worked. Now this is failing as described for me as well, and that workaround does not help. - Jmabel ! talk 23:08, 17 March 2024 (UTC)[reply]
Maybe it has something to do with the filesize. A new way of failing when the file is too large? Enhancing999 (talk) 10:46, 18 March 2024 (UTC)[reply]
It could be failing to get the file from Commons timely, thus timing out too soon.   — 🇺🇦Jeff G. please ping or talk to me🇺🇦 10:50, 18 March 2024 (UTC)[reply]
@Enhancing999.No, it is not about file size. The CropTool is failing right now. I am trying to crop a file that is "normal" size from the United States Department of State.
@Jmabel, your suggestion appeared to work once, but I have repeatedly tried this, but the tool is just not responding. The CropTool continues to show an unusual page that asks,
"What to crop? Enter the URL or filename for an image you would like to crop." I have repeatedly entered the "URL" and CropTool fails, then repeatedly entered the "filename" and CropTool fails. Please, note that this intermediate page does show in green writing below that acknowledges "this file exists on Commons."
@Jeff G., Is the following related to your "timing out" comment? There appears to be some error with the CropTool itself. The problem is intermittent in that it happens apparently anytime for unknown reason(s), but after some unknown time period, the CropTool starts working again.
CropTool has had this particular malfunction, regularly, for the last several weeks.
I have noticed this malfunction occurs during the daytime within the United States. I mention this in case it is a high-demand related issue. If the CropTool maintainer could check incoming requests for cropping, perhaps the tool is "overloaded" and starts to malfunction for volunteers with new requests. Just a guess, but I hope it helps to resolve this issue. --Ooligan (talk) 20:29, 18 March 2024 (UTC)[reply]
Pinging @Sannita (WMF)- are you aware of this recurrent issue? Thanks, --Ooligan (talk) 20:40, 18 March 2024 (UTC)[reply]
@Ooligan: I doubt there is anything Sannita can do here: this is not a WMF thing, it's a volunteer-maintained tool. There could be some specific timeout test that might be changed, but it probably runs deeper. - Jmabel ! talk 21:10, 18 March 2024 (UTC)[reply]
@Ooligan Exactly as Jmabel said, I can't do anything on this tool, since it's not maintained by WMF. Sorry. Sannita (WMF) (talk) 13:12, 19 March 2024 (UTC)[reply]
Ok. I mistakenly thought you had some connection with this tool.
@Sannita (WMF), Is there a process where I can make a suggestion to the Wikimedia Foundation to officially adopt and maintain this tool? Thank you, -- Ooligan (talk) 13:39, 19 March 2024 (UTC)[reply]
@Ooligan We already received requests about this, and unfortunately it's not in the current nor future plans to adopt community-maintained tools. There are a good number of reasons behind this decision, but the main reason is that it would require a lot of time and effort to either understand how a tool works, or to rebuild it from scratch. I tried to advocate for this, and will keep trying, but don't hold your breath waiting. Sannita (WMF) (talk) 18:39, 19 March 2024 (UTC)[reply]
Thank you @Sannita (WMF) for continuing to advocate for positive change.
You wrote that "... the main reason is that it would require a lot of time and effort to either understand how a tool works, or to rebuild it from scratch"
From a volunteer point-of-view, I think of all the 1,000's of hours of time given by volunteers at no cost to the Wikimedia Foundation to create the over 670,000+ cropped images found here at extracted images. I'm guessing most from CropTool use. The "time and effort" you mention that the WMF has a monetary value, for example, the cost per hour for code writers multiplied by the total hours to write a new version of CropTool.
An author and attorney wrote, "How much is all this volunteer time worth? A lot. The organization Independent Sector estimates that the value of volunteer time for 2019 was $25.43 per hour."
So, the WMF adoption of "community-maintained tools" is an investment that pays dividends in the form of increased productivity for all those valuable volunteers.
Just some information for your next chat with the Wikimedia Foundation representatives or staff. Thanks again. Respectfully, -- Ooligan (talk) 00:05, 20 March 2024 (UTC)[reply]
Shouldn't the WMF POV be whether this is functionality Commons should have or not? Who initially wrote it and whether current staff is qualified or not is secondary. Enhancing999 (talk) 07:07, 20 March 2024 (UTC)[reply]
@Ooligan *standing ovation* Joalbertine (talk) 16:55, 11 May 2024 (UTC)[reply]
At some point, I could do a smaller file, but not a large one. Maybe it's also a caching issue. If files gradually fill up memory, at some point no new files can be handled. Enhancing999 (talk) 21:44, 18 March 2024 (UTC)[reply]
Maybe a sample helps. I could crop:
the same from others fails:
Enhancing999 (talk) 12:45, 19 March 2024 (UTC)[reply]
@Enhancing999: I concur. In each case, it displays "Please wait while fetching image data and metadata... This might take some time depending on the image size..." and then either functions normally or returns to display "What to crop?" and "Enter the URL or filename for an image you would like to crop."   — 🇺🇦Jeff G. please ping or talk to me🇺🇦 13:26, 19 March 2024 (UTC)[reply]
Exactly! It happens to me too! I try to crop other files every time it happens, just to make sure the problem isn't limited to a single file. It never works on any file. The problem just goes away on its own after a while. It's so frustrating. Joalbertine (talk) 16:51, 11 May 2024 (UTC)[reply]
The "Enter the URL"-problem seems to be solved now by a fix by User:Lucas_Werkmeister, see MediaWiki_talk:Gadget-CropTool.js#Add_site_and_page. Enhancing999 (talk) 13:00, 21 August 2024 (UTC)[reply]
I'm getting the same error trying to crop any image from Category:Election of An Taoiseach, 22 January 2025. "Enter URL" doesn't fix the issue at all. Boardwalk.Koi (talk) 11:12, 23 January 2025 (UTC)[reply]

CropTool not working/recognizing pages on PDF file

[edit]

I recently used CropTool on a DJVu file and it was perfect, but trying to use it on File:Clifton_Johnson_-_What_They_Say_in_New_England.pdf only recognizes page one and when I try to do a crop, it recognizes the new file as a PDF (i.e. not a PNG) and it won't actually save. I can do little hacks in the URI to make other pages appear, but the same problem happens on every page. —Justin (koavf)TCM 07:02, 21 September 2024 (UTC)[reply]

Also File:Samuel Adams Drake - New England Legends and Folk-Lore (First Edition, 1884).pdf. But it works on several other PDFs. Coincidentally (?), these two PDFs that do not work also don't have proper thumbnails on Commons (yet). —Justin (koavf)TCM 08:06, 21 September 2024 (UTC)[reply]
This happened to me too, when I attempted to rotate the image in the cropping process, not only that, but croptool also chopped off the first section of code leaving the suporting code corrupted, see example here]. The latter fault happened to me several times today, where rotation was not required. Broichmore (talk) 15:43, 6 October 2024 (UTC)[reply]
Unable to get it to work on this.[1] Doc James (talk · contribs · email) 09:17, 8 January 2025 (UTC)[reply]

Structured Data

[edit]

Hi! I am reopening this comment as I am not sure if there was progress on that. It would be super if CropTool could pass on some Structured Data to crops.

I would imagine there are some "safe" properties that could be moved (e.g. coordinates); there could be an ok-list/whitelist somewhere.


For reference: https://commons.wikimedia.org/wiki/Commons_talk:CropTool/Archive_3#Structured_data https://commons.wikimedia.org/wiki/Commons_talk:CropTool/Archive_4#Structured_Data


Pinging the peolpe involved: @Schlurcher, RZuo, Jmabel, and Jheald:

There is also an open ticket on GitHub for that: https://github.com/danmichaelo/croptool/issues/207 TiagoLubiana (talk) 14:07, 18 November 2024 (UTC)[reply]

Date, anything about the camera; camera location but not object location. - Jmabel ! talk 16:52, 18 November 2024 (UTC)[reply]

Undefined error when cropping SVG files

[edit]

Hello, I was trying to crop several SVG files to remove the excess background, but it always failed and with the notification saying "Upload failed! undefined". Jauhsekali (talk) 02:57, 22 November 2024 (UTC)[reply]

I'm getting this error too, but on a .jpg file. Melmann (talk) 23:29, 3 December 2024 (UTC)[reply]
Same here. Pharma (talk) 20:35, 17 February 2025 (UTC)[reply]
same here! Nedia020415 (talk) 00:41, 4 March 2025 (UTC)[reply]

SVGs and GIFs

[edit]

Croptool is now working well on SVGs and GIFs.[2] Doc James (talk · contribs · email) 09:55, 4 February 2025 (UTC)[reply]

Similar to Croptool tool to change exposition

[edit]

Is there any Similar to Croptool tool to change exposition? Alex Blokha (talk) 23:06, 18 February 2025 (UTC)[reply]

@Alex Blokha: not sure what you mean by "exposition". Maybe lightness ("exposure", though technically "exposure" happens entirely at the time you snap the shutter, so exposure as such cannot be changed)? Or do you mean something else? - Jmabel ! talk 00:04, 19 February 2025 (UTC)[reply]
Yes, I mean lightness. I need to make image more light or more dark. Alex Blokha (talk) 01:09, 19 February 2025 (UTC), and a good tool for that takes a good bit of work; it's tricky to do client-side in a browser window. (Theoretically you could do it with JavaScript and HTML Canvas.) I'd suggest that if you need to do that, download a full-res copy to your own PC and do it there. The Colors > Curves tool in GIMP does this well and flexibly (e.g. lets you keep highlight as they are while lightening other ranges). - Jmabel ! talk 05:46, 19 February 2025 (UTC)[reply]
User:Alex Blokha Yes we built this [3] Doc James (talk · contribs · email) 16:43, 27 March 2025 (UTC)[reply]
@Doc James: I don't see anything there that looks like it has the requested capability. It looks to me like strictly a tool for adding text annotations to an image, not for making it brighter or darker. Am I missing something? - Jmabel ! talk 01:47, 29 March 2025 (UTC)[reply]
Under "filters" bottom right and then you can move the brightness toggle. You have to select the square box to the left first. Doc James (talk · contribs · email) 19:35, 29 March 2025 (UTC)[reply]
I see. That lets you change brightness over the whole image, and might deal well with straight-out overexposure or underexposure. However, in my experience, that's not terribly useful. You really want at least to be able to adjust shadows, midrange, and highlights independently, and probably the different color channels, and ideally have something like the GIMP "Curves" tool. So, yes, there are some cases that would cover, but I suspect it is a definite minority. If you want a good example of where it won't help, try looking at File:Pfeiffer Big Sur State Park - tree round 01.jpg. - Jmabel ! talk 22:29, 29 March 2025 (UTC)[reply]
How can I put it to sidebar like Croptool? Alex Blokha (talk) 20:24, 26 May 2025 (UTC)[reply]

Upload undefined

[edit]

Hello, when I cropped an image and when I tried to upload as an overwrite, it said upload failed! undefined. And also the file was a jpg. Is there a problem? Nedia020415 (talk) 00:38, 4 March 2025 (UTC)[reply]

+1. Same problem this morning. VateGV taper la discut’ 08:48, 4 March 2025 (UTC)[reply]

Tool down?

[edit]

Appears broken today... Others having problems? Doc James (talk · contribs · email) 16:43, 27 March 2025 (UTC)[reply]

Working now. Doc James (talk · contribs · email) 17:00, 27 March 2025 (UTC)[reply]
I've been having this problem, but since for the past few days, it seems that Croptool is down for good for me. It's pretty weird, the selection from my toolbox just directs me to the website instead of cropping the media file.Manually trying to input a fie into Croptool also doesn't work, even though I'm shown green. TansoShoshen (talk) 01:17, 2 June 2025 (UTC)[reply]
@TansoShoshen: It worked for me on File:Sinn Sisamouth (tight cropped).jpg, but that is no less blurry than your crop. Have you tried logging out of and back in to Commons?   — 🇺🇦Jeff G. please ping or talk to me🇺🇦 02:22, 2 June 2025 (UTC)[reply]
@Jeff G. Just tried, still not working. It could be because of the file size of what I'm trying to crop (File:Presidential Lecture by Jens Nielsen.jpg), but I've had no problem with cropping other files from OIST's Flickr stream until recently. TansoShoshen (talk) 03:34, 2 June 2025 (UTC)[reply]
@TansoShoshen: Hmm, on that file I am getting the same problem. @Danmichaelo?   — 🇺🇦Jeff G. please ping or talk to me🇺🇦 09:38, 2 June 2025 (UTC)[reply]

Cropped it here [4] using our image annotate tool. Though we still need to improve the user interface on it further. Doc James (talk · contribs · email) 15:08, 3 June 2025 (UTC)[reply]

Handling large images

[edit]

The tool fails on this. Maybe because to large. Have asked User:Bawolff to look. Doc James (talk · contribs · email) 20:25, 12 May 2025 (UTC)[reply]

@Doc James: I am having the same problem, see #Tool down? section immediately above.   — 🇺🇦Jeff G. please ping or talk to me🇺🇦 09:42, 2 June 2025 (UTC)[reply]
User:Jeff G. We have hired User:Bawolff to look into increasing the size limit.
We have also built this tool which handles larger images better.[5] Doc James (talk · contribs · email) 15:05, 3 June 2025 (UTC)[reply]

Broken image (most of the bottom part grey) in working copy, preview and result

[edit]

For certain image (which looks OK by itself), the CropTool preview of the whole image was broken, also the crop previews (considerable bottom part grey). Various refreshes did not help. Tried anyway to find out if the result would be OK. Is not. (Irrelevant note: intention was using lossless mode, precise mode was just because omission in the n-th (/final) try). File:Orphaned Land à Meyrin 2019 (40624555053) (cropped).jpg. —mykhal (talk) 06:04, 26 May 2025 (UTC)[reply]

After a more than couple of days later, the problem is gone (recropped/reupload). —mykhal (talk) 21:12, 30 May 2025 (UTC)[reply]

Replace template:own

[edit]

There has been a request since 2016 to replace template own with own work by original uploader. Is it possible to create a bot to work on all the crops since 2016 until today and check if the uploader is different, if they are then replace the template. Steinninn ♨ 13:21, 27 May 2025 (UTC)[reply]

Bug

[edit]

When a warning appears because of an attempt to save a crop with a bad filename (e.g. forgetting the .jpg), it appears that there is still a save of the file description page, e.g. here. Sdkbtalk 03:43, 2 June 2025 (UTC)[reply]