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]

WMF replacement

[edit]

At Commons:Village_pump/Technical#New_tool_for_cropping_and_rotating_images_(proposal), I added a proposal for a replacement as this tool is no longer maintained and keeps loosing functionalities. Enhancing999 (talk) 15:12, 17 April 2024 (UTC)[reply]

Unable to open any image in CropTool

[edit]

— Preceding unsigned comment added by Sohom Datta (talk • contribs) 14:11, 26 August 2024 (UTC)[reply]

I have tried several times to open an image in CropTool, but it does not open. Instead, it asks me to "[e]nter the URL or filename for an image you would like to crop". I've entered it, but again asks me to enter the same. For now, I'm using paint.net for cropping. Sbb1413 (he) (talkcontribsuploads) 12:11, 23 August 2024 (UTC)[reply]

Today I cann´t login to the tool; I received next message:
«Curl error: Could not resolve host: www.mediawiki.org»
Please, check it. Thanks. Leonprimer (talk) 05:05, 23 August 2024 (UTC)[reply]
@Sbb1413 Which image is this ?
Also looking at the publicly accessible logs, the service might need a few restarts since it seems to be having DNS issues finding mediawiki.org. (cc @Tim Starling (WMF) who recently worked on the tool and has admin access). Sohom (talk) 19:09, 23 August 2024 (UTC)[reply]

Now I could login to the tool, but I cannot open any image (I tried with large, medium and small size images). So, this is not a problem of large images upload, the tool doesn't open today any image. Please @Tim Starling (WMF): , @Sohom Datta: , can you do something to repare it? Thanks. Leonprimer (talk) 22:21, 23 August 2024 (UTC)[reply]

"Curl error: Could not resolve host: commons.wikimedia.org" DNS is still probably doing funny stuff :( Sohom (talk) 22:43, 23 August 2024 (UTC)[reply]

Doesn’t work for me as well, it tries to load something for a minute and then shows an input field as mentioned above. I tried it with File:Topographische Karte der Umgegend von Leipzig (1863).jpg and File:Topographische Karte der Umgegend von Leipzig (1854).jpg. Regards, --Polarlys (talk) 22:55, 23 August 2024 (UTC)[reply]

@Sannita (WMF), @Danmichaelo: Please, check the tool, something doesn`t work correct. Or can any other person with some experience in GitHub open a new issue here? Last time with a similar errors in the tool, end January and end April, it takes more than a week to find and repare the problem. Please this time, I hope and I desire, it will be resolved a bit faster. Thank you. Leonprimer (talk) 00:43, 24 August 2024 (UTC)[reply]
@Leonprimer: not Sannita's realm, it's a completely volunteer-maintained (or unmaintained) tool. - Jmabel ! talk 02:30, 26 August 2024 (UTC)[reply]
@Sohom Datta The image in question is the page 13 of জাতিসংঘ সম্পর্কে তোমরা যা জানতে চাও (২০১৯).pdf. I wanted to crop the photo of António Guterres from the page using CropTool, but am unable to load it in CropTool. Instead, I used paint.net for cropping this and subsequent pages. Sbb1413 (he) (talkcontribsuploads) 03:28, 24 August 2024 (UTC)[reply]
Unable to use the crop tool, which was functioning a week before. --Vjsuseela (talk) 08:07, 24 August 2024 (UTC)[reply]
Facing same problem here. AugustoResende (talk) 21:03, 25 August 2024 (UTC)[reply]

Worked just now for the first time in a while. - Jmabel ! talk 02:30, 26 August 2024 (UTC)[reply]

I still have the Enter the URL or filename for an image you would like to crop. issue. --Polarlys (talk) 08:08, 26 August 2024 (UTC)[reply]
@Jmabel and Polarlys: Same for me when I try to crop more photos from জাতিসংঘ সম্পর্কে তোমরা যা জানতে চাও (২০১৯).pdf. Sbb1413 (he) (talkcontribsuploads) 08:20, 26 August 2024 (UTC)[reply]
works here now --Polarlys (talk) 08:33, 26 August 2024 (UTC)[reply]
@Polarlys: Yes, it works for me too, both in Commons and Bengali Wikisource. Sbb1413 (he) (talkcontribsuploads) 09:13, 26 August 2024 (UTC)[reply]
It's very strange. I've had no issues using it either. Huntster (t @ c) 16:40, 26 August 2024 (UTC)[reply]

Nope, still fails to work. Same problem as above, like it's been for days. Which image is irrelevant, since it's the same error for all of them.

For others in the same boat who are able to find their way here, paint.net is a free and misleading program name. The actual URL is getpaint.net. — LlywelynII 12:39, 26 August 2024 (UTC)[reply]

Pretty sure it works on the featured image on commons right now ? The previous issue was a DNS issue that affected all of Toolforge, any issues you are having right now is a function of the image you are using. Sohom (talk) 16:49, 26 August 2024 (UTC)[reply]

CropTool not working

[edit]

I've tried to crop File:Rolfine Absalonsen.png using CropTool but it fails to load. To fix this I've tried re-logging in, using a different computer, clearing the cache and trying to open a different image and still can't use the CropTool. I'm unsure what to do next. Spiderpig662 (talk) 17:37, 26 August 2024 (UTC)[reply]

Should be working again ? Sohom (talk) 19:49, 26 August 2024 (UTC)[reply]
It's working now, thanks! --Spiderpig662 (talk) 21:31, 26 August 2024 (UTC)[reply]

Newly problem with the tool at 12th September

[edit]

@Sohom Datta, @Sannita (WMF), @Danmichaelo, @Huntster: , @Jmabel and Polarlys: Today error message: 504 The CropTool backend is currently having problems.

Please, check the tool. Leonprimer (talk) 12:16, 12 September 2024 (UTC)[reply]

Still fails to work! Waren1 (talk) 14:42, 12 September 2024 (UTC)[reply]
Same problem happened to me, - Robotje (talk) 22:23, 12 September 2024 (UTC)[reply]
Same problem for me Bloopityboop (talk) 22:31, 13 September 2024 (UTC)[reply]
Still not working. It's been a while now. Denniscabrams (talk) 13:01, 13 September 2024 (UTC)[reply]
Now it is working again. - Robotje (talk) 09:49, 14 September 2024 (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]

Crop Tools not appearing in menu

[edit]

I activated crop tools but it isn't appearing in under "Tools" in the menu on the left. Lemonademan22 (talk) 22:02, 3 November 2024 (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 techniccally "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]

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]