MediaWiki talk:Gadget-ImageAnnotator.js/Archive02

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Position of the "Add a note" button

Hi all,

I propose to slightly change the position of the "Add a note" button, so it floats to the right of the image.

Rationale: We have more an more buttons below the preview image which are pushing the actual file description (which is the primary content of a file description page!) further and further down the page. On modern wide-screen displays we should use the horizontal screen space more efficiently.

This should nicely save some space on the screen, makes it even clearer that the button is directly related to the thumbnail (since it's displayed next to it) and in the worst case (width of the browser window is to small to show the button next to the thumbnail) the button will just wrap and be displayed where it always was.

I think this should also be quite simple to implement without many code changes. If necessary I'd happily provide the adjusted code as long as there are no objections to the change. --Patrick87 (talk) 14:10, 20 September 2015 (UTC)

"Add a note" button and notes are missing

"Add a note" button and notes are missing! --Andreas Schwarzkopf (talk) 06:52, 2 June 2016 (UTC)

I can confirm this, as reported here, this appears from Firefox 46.0 to 47.0 (same to Opera 37.0). User: Perhelion 10:30, 8 June 2016 (UTC)
Cannot reproduce. The button is supposed to be visible only for logged-in (and (auto-)confirmed) users. Lupo 20:15, 9 June 2016 (UTC)

Galleries

Good morning to everybody!

I there a possibility to make a gallery show annotations? I used some html instead, but that doesn't center the images properly relative to the text above, which quite bothers me. For some reason, it seems that the "center" is the right side of the left image.

Heading
1234
1234

--David.Mirth (talk) 07:20, 22 April 2017 (UTC)

Hi David- Here's a test as an FYI. I have near-zero expertise in this realm, but tried a couple tricks for fun. This one got the heading to center, though I'm guessing that removing the "thumb" parameter might not be right for a gallery. --Eric talk 16:25, 22 April 2017 (UTC)
Thank you, Eric, this might be a bit of a solution, though I'd like the thumb to be there, maybe it's better :) If anyone had other solutions, I'd be happy, but I will possibly use this one :) --David.Mirth (talk) 13:39, 23 April 2017 (UTC)
@David.Mirth: Glad to help if I did, but I feel like it's just a workaround. But this section of WP's image editing tutorial might provide some useful guidance: Wikipedia:Picture_tutorial#Overlaying_annotations_on_an_image. It has a couple links to annotation templates, and note that the section itself has what looks like a centered caption above it. Eric talk 14:21, 23 April 2017 (UTC)

Bug

Heavy Bug

de: … folgende Situation: mit dem ImageAnnotator einen oder mehrere Kommentare hinzugefügt. Diese werden auch oberflächlich gesehen gespeichert. Wenn man aber mit dem HotCat eine Kategorie hinzufügt – wird angezeigt, dass man eine ältere Version editiert (bzw. die ImageAnnotator-Ergänzungen verworfen sind). Schau auch dir diese Versionsgeschichte an, dem Benutzer ist das gar nicht aufgefallen – und das bei mehreren Bildern. --Atamari (talk) 08:06, 2 June 2017 (UTC)

@Krinkle, Didym, Perhelion, and Zhuyifei1999 (perhaps who else?). English translation and service links: Bug with ImageAnnotator and HotCat: Image annotations are saved, but when afterwards categories are changed with HotCat one gets a notice, that an old version would be edited respectively the additions by ImageAnnotator were discarded. Cf. these changes: First, the user added image annotations in several steps: Special:Diff/240058930/240250337. Then, straight afterwards he changed a category: Special:Diff/240250337/next. The user didn’t even notice this, and it happened for him with several other images, too. — Speravir – 23:16, 15 June 2017 (UTC)
Both this script and hotcat are old and are better off rewritten with jQuery and, for this script, API and not MediaWiki:LAPI.js --Zhuyifei1999 (talk) 00:17, 16 June 2017 (UTC)
+1 So this is rather a bug of HotCat (in this concrete example). -- User: Perhelion 08:51, 16 June 2017 (UTC)
I started to rewrite this script (using jQuery and API if available while leaving some handy LAPI functions), but I haven’t finished it, partly because it seems to become useless because of the FileAnnotations extension. If you think it’s still useful, I try to finish it (I will first deploy it to a Hungarian-language project, probably Wikipedia or Wikisource, so that it won’t break for hundreds of thousands of users if I do a mistake). --Tacsipacsi (talk) 13:44, 16 June 2017 (UTC)

Remove unnecessary text

{{Edit request}} Not that important, but when there are other changes this could be done additionally:
Please, remove the unneeded first and last line respectively, i.e. remove

// <source lang="javascript">

and

// </source>

Syntaxhighlighting works nowadays without this tag, in fact it prevents proper highlighting. — Speravir – 23:32, 15 June 2017 (UTC)

I think the highlighting is prevented because of the large size of this script, not because of these tags. On the other hand, the benefit of keeping these tags is that they will act like nowiki-tags, and things inside this script will not go through mediawiki parser (eg. subst-tags, transclusion-count) --Zhuyifei1999 (talk) 00:07, 16 June 2017 (UTC)
Ah, yes. But why not change to nowiki? As I wrote, only en passant, of course. — Speravir – 00:31, 16 June 2017 (UTC)

Allow the note-editor dialog box to be moved

When I select a rectangle for a new note, the yellow editor box appears near the selected area. But sometimes it overlaps the area (or another adjacent area) that I wish to see while I'm writing the note. It would be useful if I could drag the whole dialog box to reposition it on the screen. DMacks (talk) 19:22, 4 July 2017 (UTC)

 Support I use annotations for texts of inscriptions in the image. Should be able to read it in place when typing. --Ikar.us (talk) 08:17, 14 August 2017 (UTC)
Good idea. jQuery UI (which is used by e.g. the WikiEditor toolbar) has movable popups, although it’s being deprecated by Wikimedia and changed to OOjs UI (the edit interface now uses the latter everywhere, except on enwiki and Commons), which has no movable popups… --Tacsipacsi (talk) 16:57, 14 August 2017 (UTC)

x=-1

In https://commons.wikimedia.org/w/index.php?title=File:Glory-Life_Königstraße.jpg&diff=253976794 , the annotator produced a coordinate outside the image. --Ikar.us (talk) 08:38, 12 August 2017 (UTC)

Image removed from watchlist

Since a few weeks adding a note to an image the file page is removed from automatically my watchlist. Can anyone confirm this issue? Raymond 17:50, 22 November 2017 (UTC)

Yes, But unable to find out why. There is nothing in the code which affects the watchlist as far i can see. And it looks like this tool does not use the usual api? --Steinsplitter (talk) 18:51, 22 November 2017 (UTC)
It doesn’t use the MediaWiki API at all, it saves the edit using index.php, and, as it turns out, it removes the page from the watchlist if the POST request doesn’t contain the wpMinoredit parameter. The gadget should be completely rewritten to use the modern APIs, but who will do it… —Tacsipacsi (talk) 19:56, 22 November 2017 (UTC)
Maybe it can be replaced by the real MediaWiki extension FileAnnotations. But I am unsure how complete/ready for beta testing the extension is. Maybe Mark could say something about it? Raymond 20:30, 22 November 2017 (UTC)
I would fill a Phab task. The code is indeed old and very expensive. I could also not recognize any reason for this. (@Lupo and Krinkle: ) -- User: Perhelion 22:33, 23 November 2017 (UTC)
I think it’s clear why does it remove the page from watchlist: it uses index.php for editing instead of api.php, most likely because it was created before the MediaWiki API. I don’t know how to replace it with an API call. —Tacsipacsi (talk) 22:42, 23 November 2017 (UTC)
@Tacsipacsi: Where do you find that? All edits are going over MediaWiki:LAPI.js. -- User: Perhelion 11:03, 24 November 2017 (UTC)
PS: You seems right, it submit it over MediaWiki:AjaxSubmit.js. It creates a fake form and then submit it without the common "wpWatchthis" element (which result now as not watching). So we need only to create this as hidden check element!? -- User: Perhelion 12:44, 24 November 2017 (UTC)
I tried to find where the actual edit occurs in the code, but I gave up, so I made a test edit and watched my browser console. I wanted to see what parameter it uses for the API request and it turned out that none. I don’t think adding another element to the fake form is the best solution, we should rather use the MediaWiki API. —Tacsipacsi (talk) 16:25, 24 November 2017 (UTC)
✓ Fixed @Tacsipacsi, Raymond, MarkTraceur, Lupo, and Krinkle: Fixed it in MediaWiki:AjaxSubmit.js. I really wanted to use the mw.Api but the effort seemed me to big (after some code check, and I'm pleased to see an old XMLHttpRequest working here). PS: for test File:Arab_Spring_map.svg (go not west) -- User: Perhelion 20:54, 9 December 2017 (UTC)
@Perhelion: Thank you very very much, a very important pre-xmas present :-) Raymond 21:37, 9 December 2017 (UTC)

'Add a note' button not appearing

I went to w:File:Cookie clicker game screenshot.png to add an image annotation. I am autocofirmed on Wikipedia. I have the gadget enabled in my Wikipedia prefrences, but the Add a note button did not appear. It does appear at User:T2Bean/imagenote-sandbox, but not on any other Wikipedia image. It appears on all Commons images.

Following instructions at Help:Gadget-ImageAnnotator#Problems?:

I am running Gooogle Chrome, Version 74.0.3729.108 (Official Build) (64-bit). My Wikipedia gadgets are:

  • ImageAnnotator
  • Navigation popups
  • Enable the Teahouse "Ask a question" feature
  • Reference Tooltips
  • FormWizard


  • Geonotice
  • (This loads the base style for the watchlist. Please do not disable this option.)
  • Display watchlist notices
  • Display green collapsible arrows and green bullets for changed pages in your watchlist, page history and recent changes (unavailable with the improved Watchlist user interface)
  • Display pages on your watchlist that have changed since your last visit in bold (see customizing watchlists for more options)
  • Subtle update marker: Tone down the "Changed since last visit" indicator on history pages. (By default it renders as a green-filled bar, enabling this gadget changes it to green text.)


  • HotCat
  • wikEdDiff
  • ProveIt
  • Shortdesc helper
  • Form for filing disputes at the dispute resolution noticeboard
  • CharInsert
  • refToolbar
  • Add extra buttons to the old (non-enhanced) editing toolbar


  • Add an [edit] link for the lead section of a page
  • Add a "Purge" option to the top of the page, which purges the page's cache
  • Add a selector to the Wikipedia search page allowing the use of external search engines
  • MoreMenu
  • Replace the "new section" tab text with "+"
  • Change UTC-based times and dates, such as those used in signatures, to be relative to local time
  • Display a floating alert for new talk page messages
  • PrettyLog
  • Show radio buttons to switch between views of certain content, such as some maps
  • Display links to disambiguation pages in orange
  • XTools


  • Real-Time Recent Changes


  • AddMe
  • Make sure that headers of tables remain in view as long as the table is in view (requires Firefox v59 or Safari)
  • Install scripts without having to edit your JS files

I use the vector skin. My language is EN-gb (British English). Steps I took:

  1. Navigated to Wikipedia.
  2. Clicked 'contributions' (top-right). This took me to [1].
  3. Clicked on 'File:Cookie clicker game screenshot.png', which took me to here.

When I looked, there was no Add a note button.

One error was reported in my console:

load.php?debug=false&lang=en-gb&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets|oojs-ui.styles.icons-editing-advanced&skin=vector&version=1u73ou7:130 [Report Only] Refused to connect to 'https://xtools.wmflabs.org/api/page/articleinfo/en.wikipedia.org/File:Cookie_clicker_game_screenshot.png?format=html&uselang=en-gb' because it violates the following Content Security Policy directive: "default-src 'self' data: blob: upload.wikimedia.org https://commons.wikimedia.org meta.wikimedia.org *.wikimedia.org *.wikipedia.org *.wikinews.org *.wiktionary.org *.wikibooks.org *.wikiversity.org *.wikisource.org wikisource.org *.wikiquote.org *.wikidata.org *.wikivoyage.org *.mediawiki.org wikimedia.org". Note that 'connect-src' was not explicitly set, so 'default-src' is used as a fallback.

Ask me if you have any questions. --T2Bean (talk · contribs) 07:12, 3 May 2019 (UTC)

Problem

{{Editprotected}} Hello. Since a couple of days, I have the same problem everytime I try to add an note on a picture. I get the following error message: "Exception Error: Version inconsistency after saving. Please reload the page. Could not save your note (edit conflict or other problem). Please copy the text in the edit box below and insert it manually by editing this page." When I reload the page, the note I was trying to add appear, so it seems the annotator tries to insert the note twice and it fails the second time. BrightRaven (talk) 14:40, 20 May 2019 (UTC)

I have the same problem and I solved it this way. You click the "cancel" button and it will save it. You will see the note once you reload the image. Anyhow it is annoying. Cheers --Wolfgang Moroder (talk) 20:02, 20 May 2019 (UTC)
Yes, I do the same thing, but it is annoying, especially if you want to add several notes in a row. BrightRaven (talk) 07:15, 21 May 2019 (UTC)
I had the same problem. Now the notes button isn't even appearing on image files. What's going on? — LlywelynII 09:00, 12 June 2019 (UTC)
same for me --Herzi Pinki (talk) 15:03, 25 June 2019 (UTC)

@Lupo: Maybe you could help with this? -- Darwin Ahoy! 13:09, 30 June 2019 (UTC)

  • Clearly something is going wrong in the call where we set var revision_id = LAPI.WP.revisionFromHtml( request.responseText ) because we are getting "Version inconsistency after saving. Please reload the page" every time. If this can't be properly fixed, perhaps it could just force a reload itself, since that is inevitably what the user has to do. - Jmabel ! talk 00:41, 3 July 2019 (UTC)
I can't change this myself (not an admin anymore), but the regexp used in LAPI.WP.revisionFromHtml() no longer matches. Should now be something like /RLCONF=\{.*"wgCurRevisionId"\s*:\s*(\d+),/. Used to get the new page revision after a note has been saved to update the revision id on the current page (where the user is editing notes) so that subsequent edits work without having to reload the page. Lupo 19:43, 6 July 2019 (UTC)
✓ Done @Jmabel, DarwIn, Herzi Pinki, BrightRaven, Moroder, and LlywelynII: I applied the fix by Lupo. So is it working again? -- User: Perhelion 23:49, 29 July 2019 (UTC)
Yes, on my end the notes are just saving again instead of forcing a reload. Thank you very much, and if you see whose edit broke it the first time let them know so it's less likely to happen again.
May be WAD but for some reason This larger image takes notes just fine but this large but smaller image doesn't even provide the option of adding them. Have notes never worked for PNGs? Any good reason why, since it's just adding a layer over the file here? — LlywelynII 01:50, 30 July 2019 (UTC)
@Perhelion: Thanks, looks good again. --Herzi Pinki (talk) 05:32, 30 July 2019 (UTC)
It works again for me. Thank you. BrightRaven (talk) 07:42, 30 July 2019 (UTC)
✓ Done Thanks all. -- User: Perhelion 13:51, 30 July 2019 (UTC)

Code position

Hi, would it be possible to add the code from the Gadget at the top of the page rather than the bottom? Conceptionally, image annotations belong to the image, which is displayed first on the page, even before any descriptions. Please let me know your thoughts. --Schlurcher (talk) 13:36, 10 September 2019 (UTC)

Hi Schlurcher, on top, before the information field, sounds not very practicable for editors. The image annotation code is nothing I edit manually in the file page. As 2nd last element, before the categories, would be better I think. Raymond 14:09, 10 September 2019 (UTC)
See the bottom of User talk:Schlurcher. In short, Schlurcher runs a bot that's approved to move categories to the bottoms of file pages, since that's where they normally go. However, the gadget normally puts the annotation code at the bottom, so if you add an annotation and do nothing else, it's highly likely that your edit will trigger a visit from the bot. Whether it's changing the bot's instructions, or repositioning the default location for annotations, or something else, we really ought to do something so that the ordinary operation of a common gadget doesn't cause a highly active bot to think something's wrong. Nyttend (talk) 01:55, 12 September 2019 (UTC)
  • I noticed this edit among several such, and wanted to suggest an improvement — and now I find out that this very matter is being duscussed here. Okay, in my opinion cats at the bottom is good, so this edit is good, but, as said above, image notes pertain to the image. Moving all cats down puts the image note wikitext at the bottom of everything else, usually in the file page section implicitly defined by the licensing H2, and that’s not good because image notes usually do not pertain with licensing per se. I suggest that they belong immediately before the licensing H2, that is, at the bottom of the file description section. Anyway, thanks to Schlurcher for their bot work. -- Tuválkin 23:39, 25 September 2019 (UTC)
  • The image notes should be at the bottom of the wikitext since users should not edit them manually and thus can just ignore everything down there. Bots can be made smart enough to not blindly move cats to the bottom but do what makes sense. (In all fairness, image notes should not be in the wikitext at all. But ImageAnnotator was a proof of concept to show it could be done, and there was no other way to have (a) adding/removing image notes appear in the page history, and (b) ensuring the notes were in sync with the page, even when images get moved around. if somebody re-did ImageAnnotator with server-side support, it could be done better.) Lupo 12:25, 26 September 2019 (UTC)
  • Lupo says that «image notes should not be in the wikitext at all». That’s Lupo’s opinion and I very strongly disagree with it. Everything should be in wikitext (that’s my opinion). -- Tuválkin 14:39, 26 September 2019 (UTC)
    First, I'm very glad to see Lupo is visiting his old tools from time to time. Secondary, I do agree Tuválkin in this point, but I also understand Lupos reasons.
    Categories at the very bottom should be the prior standard for the Wikitext (except former interwiki-links).
    So I guess now, with a consensus (except of Lupo), there is an edit request for resolving this!? -- User: Perhelion 15:30, 26 September 2019 (UTC)
  • Lupo please help me understand "what makes sense". Currently the only option I see is to ignore pages with Image Annotations. --Schlurcher (talk) 07:57, 1 October 2019 (UTC)

Error when adding note to image on Commons

(Copied from phab T235170)

If one attempts to add a note (using Gadget-ImageAnnotator) to an image on Commons one gets the error "Could not save your note (edit conflict or other problem). Please copy the text in the edit box below and insert it manually by editing this page." Despite there being no edit conflict.

See JavaScript here

Replicate:

  1. Go to an image on Commons and click the Add note button below the image
  2. Type test and click Save

Actual result: Error

Expected result: Note publishes to image and page reloads

macOS Chrome Version 77.0.3865.90 (Official Build) (64-bit)

Default skin

No console errors.

Thanks Waddie96 (talk) 12:56, 10 October 2019 (UTC)

Enable WebP file extension

{{Edit request}} The script has to be updated with WebP file extension. It is missing in line 1743. Old:

if ( name.search( /\.(jpe?g|png|gif|svg|tiff?)$/i ) < 0 ) { return null; } // Only PNG, JPE?G, GIF, SVG, and TIFF?

New:

if ( name.search( /\.(jpe?g|png|gif|svg|tiff?|webp)$/i ) < 0 ) { return null; } // Only PNG, JPE?G, GIF, SVG, TIFF?, and WebP

— Speravir – 22:16, 21 June 2020 (UTC)

✓ Done --Didym (talk) 22:22, 24 June 2020 (UTC)

not working

I noticed first on File:Luftbild von Pforzheim.jpg that neither the existing annotations nor the annotator button are displayed.

Both in Chrome and in Firefox, and regardless whether I am logged in or not.

--Ikar.us (talk) 08:07, 11 September 2020 (UTC)

Works for me now. --Ikar.us (talk) 06:58, 12 September 2020 (UTC)

Missing for me as of this writing. -- DanielPenfield (talk) 18:49, 8 October 2020 (UTC)

Very Late Stage (=Wrong) Appearance of annotations in de-Wikipedia

Test pic 1 with annotations by threadstarter
Test pic 2 with annotations from 2009 by another user

One of my pics of 2009 was annotated by another user, the mountain pic to the right. The toolbox pic on top I uploaded and annotated with 9 notes some days ago. PROBLEM: In the German Wikipedia (MUCH different from what is displayed here...), the thumbs of both pics included in an article or talk page show no annotations at all (resp. none are visible), and when one clicks on the thumb pic (either one of the two pics), the "image viewer" appears -also without- showing the annotations. When then proceeding to the Commons page, the annotations are -still not visible-. Only after clicking on the blue "Weitere Einzelheiten" Button ("More Details" in the English Commons page), at this last possible stage the annotations appear as they are meant to appear. This is reproducable with both pics, and both with Microsoft Edge and a new Firefox.

Is this normal or some type of failure (or, supposedly only happens to me)? Info: Both pics are, for example, included on the talk page of the de-article "Knarre (Werkzeug)" (de:Diskussion:Knarre_(Werkzeug)) where the above problem was observed by me exactly as described above. Pittigrilli~commonswiki (talk) 16:14, 19 October 2020 (UTC)

@Pittigrilli: This is an old task, see Task 150648. I really would like that this would be fixed too. Raymond 16:44, 19 October 2020 (UTC)
@Pittigrilli: It works on enwiki, though it was broken for a while due to tooltips.js being missing. However, it requires the gadget to be manually enabled in preferences first, and it does not show in thumbnails (or the image viewer) due to the configuration. But it does correctly show tooltips from commons on the file description page on enwiki (for instance, File:0.10_Exhibition.jpg works on commons, and en:File:0.10_Exhibition.jpg works on enwiki with the gadget enabled). I'm not sure if dewiki works the same. --Pokechu22 (talk) 18:26, 19 October 2020 (UTC)
Thanks for the answers. I tried to include the toolbox-pic also in two en-articles (en:Toolbox and en:Sochet wrench) where it still is (fits well), but (at least I) see the same error there as I described above for the de-WP. No annotations at all, until the "More details" button on commons is clicked. Pittigrilli~commonswiki (talk) 21:43, 19 October 2020 (UTC)

"importScript is not defined"

I'm trying to install this on my wiki which is on version 1.35.1 but I get this importScript error when viewing file pages, so the Add Note button doesn't appear.

Is there any way to solve this? I'm confused as to how it works on this site and Wikipedia since I read that importScript is deprecated. --Vishkujo (talk) 02:39, 20 February 2021 (UTC)

Never mind, I fixed it by replacing all of the importScript here and in LAPI.js with mw.loader.load. --Vishkujo (talk) 02:57, 20 February 2021 (UTC)

Exception Error

When I click a button "Add a note" below image, draw a rectangular, type a note, click "save" button, then the Exception Error always pops up. This is the whole message:

Exception Error: Server reply does not contain mandatory form.

Could not save your note (edit conflict or other problem). Please copy the text in the edit box below and insert it manually by editing this page.

I searched past questions but I could not find any helpful advice. The pictures I was trying to add a note are File:Donhwamun Area.jpeg and File:대한민국 임시정부 신년축하식을 마치고(1920년1월 1일).jpg, which are not protected at all. I wish this problem be solved.— 사도바울 (talk) 04:13, 12 April 2021 (UTC)

@사도바울: I was able to successfully add annotations to both images (I've reverted those test edits afterward). Looking at MediaWiki:LAPI.js (which is what creates the "Server reply does not contain mandatory form" message), do you maybe have the mw:VisualEditor enabled? If so try with it disabled. --Pokechu22 (talk) 04:33, 12 April 2021 (UTC)
@Pokechu22: I am sorry but I have little knowledge on Javascript.. I can add annotations by simply typing the raw code, but this function must be work on VisualEditor as well. Thanks for regarding:)— 사도바울 (talk) 04:51, 12 April 2021 (UTC)
I tried after disabling VisualEditor on my Preferences>Editing, however, it does not work still.— 사도바울 (talk) 05:04, 12 April 2021 (UTC)
Oh! I checked Visual editing out from Beta features, and it works! Thank you:)— 사도바울 (talk) 05:06, 12 April 2021 (UTC)
@사도바울: I tried VisualEditor myself; it seems that the gadget works correctly with both "Visual editing" and "New wikitext mode" disabled in Preferences→Beta features, but it also works correctly is only one is enabled (so "Visual editing" enabled and "New wikitext mode" disabled or "Visual editing" disabled and "New wikitext mode" enabled). I experienced the error when both "Visual editing" and "New wikitext mode" were enabled though. I don't think the option on Preferences→Editing is relevant (as you seem to have figured out). Glad you got it working! --Pokechu22 (talk) 05:10, 12 April 2021 (UTC)
I found this worked as well when having the same error. It's a headache to unset if you're using global prefs as well. ~Gwennie🐈💬 📋02:48, 6 September 2021 (UTC)

No button "Add a note"

Bonjour,

sur une des images, je n'ai pas de bouton "Ajouter une note", alors que sur toutes les autres je l'ai voici l'image qui pose problème : File:Kalachakra 2014 (14676039504).jpg j'ai vérifié mes paramètres perso, j'ai bien l'option annotations d'image qui est activée

On image description pages, the script ImageAnnotator adds a button "Add a note" below the preview image. i have the button on all the description paqes except this one : File:Kalachakra 2014 (14676039504).jpg

Djampa (talk) 10:37, 8 January 2022 (UTC)

File:Kalachakra 2014 (14676039504).jpg is missing the button for me too. I tried three tests but the button did not show up in any of the cases. Note also that there is a note on the page, and that note is not visible either. @Asclepias, do the button and the note exist for you? --Pokechu22 (talk) 18:57, 8 January 2022 (UTC)
The note that was added by Djampa yesterday at 10:01 was not visible. And since you readded it today at 18:54 it is not visible either. For me, the button always was there and still is there. The note I added today at 18:17 was visible on the image, but obviously it is not there anymore since you removed it a few minutes later at 18:53, which now makes useless the comment I made to Djampa on the Bistro. It would have been a useful information to know if the users who do not see the button could have seen that note. -- Asclepias (talk) 19:28, 8 January 2022 (UTC)
I've switched to your version of the note, but neither version works for me. (I had assumed that there were only whitespace differences between the two so I chose the older version, but the position, size, and dimy values are also different - those may be relevant. My mistake.)
What size does the image say it is? For me I see "Size of this preview: 800 × 520 pixels." and "Original file ‎(1,600 × 1,039 pixels, file size: 262 KB, MIME type: image/jpeg)" --Pokechu22 (talk) 19:40, 8 January 2022 (UTC)
The note is now visible again. The sizes of my preview and original are the same as yours. -- Asclepias (talk) 19:46, 8 January 2022 (UTC)

Same issue with me, for instance File:Matterhorn from Domhütte - 2.jpg is not showing any annotation nor any button, while this one does, tried in several browsers. Zach (Talk) 14:43, 10 January 2022 (UTC)


Je suis tombé sur d'autres photos qui n'ont pas de bouton :

Djampa (talk) 06:50, 11 January 2022 (UTC)

As far as I can track it down (tested on different hardware/browsers) it looks like commons only works (something important change in recent weeks?!) with the "vector" skin. I had trouble (strangely only sometimes) with other gadgets too and no matter which I deacivated or not, the only thing that looks to work, is switching to the skin "vector" (even the "clasic" seems to work until now ... if that breaks too, I'm done with commons, since I won't search the menus to get to my watchlist or contributions ...). --Mirer (talk) 08:03, 11 January 2022 (UTC)

I have the same problem: the add note-Button does not appear on File:Dusseldorf, Germany after one week of Royal Air Force bombing, June 1943 (27804339421).jpg (it worked before a new rotated version of the image was added), but does work on almost every File, like File:Hangrutsch Kestert 2021 2.jpg. Switching skins did not show any effect, nor did removing all pre-rotation image note information from the page. Can anybody help? --Joschi71 (talk) 18:10, 19 January 2022 (UTC)

I uploaded an image from Flickr (File:Kandersteg Church.jpg), successfully added an annotation, User:FlickreviewR 2 passed cc-by-sa-2.0, then... broken! Zach (Talk) 14:24, 3 February 2022 (UTC) Again, with File:Kandersteg Valley.jpg, the image annotator broke just after User:FlickreviewR 2 edit. Zach (Talk) 18:55, 3 February 2022 (UTC) UPDATE: I uploaded a cropped version a the file and now the image annotator works... totally fine. Zach (Talk) 19:15, 3 February 2022 (UTC)

I get this intermittently. And it will work fine on one image while being broken on another, and is uncorrelated to whether the image has existing annotations. - Jmabel ! talk 23:26, 11 February 2022 (UTC)

Is this page useful to something because I got the same problem as my predecessors, and no one seems to take it into account. Regards. LeoAlig (talk) 08:21, 4 March 2022 (UTC)
File:Chinese-operated Khmer-Vietnamese restaurant.jpg also broken. RZuo (talk) 16:25, 26 April 2022 (UTC)
@Krinkle: are you still maintaining this? Fish bowl (talk) 01:47, 28 April 2022 (UTC)
I do not. I have in the past made changes to its source code as part of general clean up for all Commons gadgets. I do not consider myself especially familiar with this gadget and am not a maintainer of it. Krinkle (talk) 12:54, 28 April 2022 (UTC)
  • Same problem persists intermittently. One day, I see annotations normally, another day it's never shown. I'm editing from Russia, so there might be issues with accessing some Wikimedia servers - but then switching to not-yet-blocked VPN nodes does not change much. If it's a "day off", it's off in Sweden and Estonia alike. Retired electrician (talk) 16:20, 28 May 2022 (UTC)

Same problem here. I’ve tried my eight latest uploads with the following result:

Works with
File:Feldberg-Skimatten-ks01.jpg
File:Freistaat Flaschenhals Schild freigestellt.png (the 1:1 preview window does not show up here)
File:Dog face with vibrissae.jpg (the 1:1 preview window does not show up here)
Does not work with
File:Heidenhäuschen-gipfel-basaltfelsen.jpg
File:Ewiges Eis Dornburg Infotafel.jpg
File:Ewiges Eis Dornburg.jpg
File:Riesengebirge mit Schneegruben ks01.jpg
File:Grosser Feldberg 2022-05 ks01.jpg

"Does not work" means that the "Add a note" button does not appear at all.

Firefox 102.0.1 64bit, Kubuntu 22.04, no relevant plugins to affect this as far as I see.

--Kreuzschnabel 21:06, 26 July 2022 (UTC)

If you ask me, apparently it works perfectly on narrow portrait-oriented images, less perfectly (no preview popup) on nearly-sqare shaped or non-jpg images, and not at all on landscape oriented images. --Kreuzschnabel 21:11, 26 July 2022 (UTC)
@Jon (WMF): I have been having this problem intermittently for years. Mostly, it works, sometimes it does not. When loading an image in the browser (I use Firefox 103) and the image is finally displayed completely, it usually takes a few further moments (0,5 - 1 sec.) until the "Add a note" button shows up. Sometimes it will never show up - looks as if a process gets stuck. The files mentioned by Kreuzschnabel on July 26 work for me. The files mentioned by Djampa won't. In addition, for example File:Fagradalsfjall oli 2021177.jpg won't. I doubt that the image orientation is relevant. However, it seems to me as if smaller images (< 500 KBytes) may tend to make trouble more often. Perhaps it's a question of JPG compression? --Kuhni74 (talk) 13:04, 5 August 2022 (UTC)
I noticed that when I try editing e.g. the description of a problematic image immediately (few sec.) after loading the page, my browser will display the message "this page is asking you to confirm that you want to leave - data you have entered may not be saved". This message usually occurs when I'm entering data on a page and try to leave it without saving. This supports my theory that an editing process hangs. --Kuhni74 (talk) 15:07, 8 August 2022 (UTC)

Annotations not appearing on GIF description page

Good day, it was brought to my attention that the annotations present at File:Machine à Vapeur en LEGO.gif are not showing up when viewing the image page itself, but do show up when the image is transcluded somewhere, such as as Template:Motd/2019-01#07. Additionally, there is no longer an "Add a note" button on GIF images. Any ideas as to what might be happening? Thanks. Huntster (t @ c) 23:13, 11 June 2022 (UTC)

In fact, I was able to see by changing the extension of the definition page of the incriminated image to .txt, that my old notes are still present there in the code. They are there but they are not expressed... Sincerely, Bernard de Go Mars (talk) 20:20, 21 June 2022 (UTC)

Annotations not appearing on GIF description page

Good day, it was brought to my attention that the annotations present at File:Machine à Vapeur en LEGO.gif are not showing up when viewing the image page itself, but do show up when the image is transcluded somewhere, such as as Template:Motd/2019-01#07. Additionally, there is no longer an "Add a note" button on GIF images. Any ideas as to what might be happening? Thanks. Huntster (t @ c) 23:13, 11 June 2022 (UTC)

In fact, I was able to see by changing the extension of the definition page of the incriminated image to .txt, that my old notes are still present there in the code. They are there but they are not expressed... Sincerely, Bernard de Go Mars (talk) 20:20, 21 June 2022 (UTC)

Currently, there could be a race condition. If MediaWiki:Common.js is executed before MediaWiki:Gadget-DisableImageAnnotator.js, the global variable ImageAnnotator_disable isn't yet defined, so the gadget doesn't get disabled.

It can be fixed, as we are able to know if the user has checked the DisableImageAnnotator gadget: mw.user.options.get('gadget-DisableImageAnnotator')

Thus, the new code in MediaWiki:Common.js would be:

// Not on Special pages, and only if viewing the page
if (mw.config.get( 'wgNamespaceNumber' ) >= 0 && ['view', 'submit'].indexOf(mw.config.get('wgAction') ) !== -1 ) {
 if ((typeof ImageAnnotator_disable === 'undefined' || !ImageAnnotator_disable) && !mw.user.options.get('gadget-DisableImageAnnotator')) {
  // Don't even import it if it's disabled.
  mw.loader.load( '/w/index.php?title=MediaWiki:Gadget-ImageAnnotator.js&action=raw&ctype=text/javascript' ); // Backlink: [[MediaWiki:Gadget-ImageAnnotator.js]]
 }
}

(I also replaced mw.config.get( 'wgNamespaceNumber' ) !== -1 with mw.config.get( 'wgNamespaceNumber' ) >= 0 because new special namespaces might be added in the future)

The conditionals are a bit tricky to understand. The following variant may be easier to understand:

// Not on Special pages, and only if viewing the page
if (mw.config.get( 'wgNamespaceNumber' ) >= 0 && ['view', 'submit'].indexOf(mw.config.get('wgAction') ) !== -1 ) {
 if ((typeof ImageAnnotator_disable !== 'undefined' && ImageAnnotator_disable) || mw.user.options.get('gadget-DisableImageAnnotator')) {
  // Don't even import it if it's disabled.
 } else {
  mw.loader.load( '/w/index.php?title=MediaWiki:Gadget-ImageAnnotator.js&action=raw&ctype=text/javascript' ); // Backlink: [[MediaWiki:Gadget-ImageAnnotator.js]]
 }
}

Another thing: It's a shame to load MediaWiki:Gadget-ImageAnnotator.js using mw.loader.load( <raw url> ) (one more HTTP request, less efficient caching, unminified…) whereas we can take advantage of the ResourceLoader:

Od1n (talk) 01:38, 23 August 2022 (UTC)

Ah, just remembered we would need to add a dependency to the user.options module: mw.loader.using( 'user.options', function () {...} )
Also, I just searched on the wiki, no one had manually put [window.]ImageAnnotator_disable = true in their common.js/vector.js/etc. This is nice, as we can leave out the "ImageAnnotator_disable" test, as it is redundant with the "mw.user.options" test. (also, it would have required a dependency to user, another module…)
So, with a bit of formatting, the result would be:
// Not on Special pages, and only if viewing the page
if ( mw.config.get( 'wgNamespaceNumber' ) >= 0 && [ 'view', 'submit' ].indexOf( mw.config.get( 'wgAction' ) ) !== -1 ) {
    mw.loader.using( 'user.options', function () {
        if ( mw.user.options.get( 'gadget-DisableImageAnnotator' ) ) {
            // Don't even import it if it's disabled.
        } else {
            mw.loader.load( 'ext.gadget.ImageAnnotator' ); // Backlink: [[MediaWiki:Gadget-ImageAnnotator.js]]
        }
    } );
}
Od1n (talk) 07:07, 23 August 2022 (UTC)
Actually, it would be much cleaner to do what all other default gadgets do: define the ImageAnnotator gadget as a default, non-hidden gadget, don’t load it from Common.js, letting users turn the gadget off, and forget MediaWiki:Gadget-DisableImageAnnotator.js. Someone with direct access to the database can migrate the preferences.
(Re I also replaced mw.config.get( 'wgNamespaceNumber' ) !== -1 with mw.config.get( 'wgNamespaceNumber' ) >= 0 because new special namespaces might be added in the future—I don’t think any new special namespaces will appear in the future. If they do, who knows, enabling ImageAnnotator there might actually be a good thing.)Tacsipacsi (talk) 21:03, 23 August 2022 (UTC)
Indeed, that would be even better. Though, it would require to request on Phabricator a database query, and I had no luck with such request previously (simply asking to rename a gadget, T186702). But if you are granted the database request, that would definitely be the best option. Od1n (talk) 22:26, 23 August 2022 (UTC)

No button "Add a note"

{{Edit request}} Bonjour,

sur une des images, je n'ai pas de bouton "Ajouter une note", alors que sur toutes les autres je l'ai voici l'image qui pose problème : File:Kalachakra 2014 (14676039504).jpg j'ai vérifié mes paramètres perso, j'ai bien l'option annotations d'image qui est activée

On image description pages, the script ImageAnnotator adds a button "Add a note" below the preview image. i have the button on all the description paqes except this one : File:Kalachakra 2014 (14676039504).jpg

Djampa (talk) 10:37, 8 January 2022 (UTC)

File:Kalachakra 2014 (14676039504).jpg is missing the button for me too. I tried three tests but the button did not show up in any of the cases. Note also that there is a note on the page, and that note is not visible either. @Asclepias, do the button and the note exist for you? --Pokechu22 (talk) 18:57, 8 January 2022 (UTC)
The note that was added by Djampa yesterday at 10:01 was not visible. And since you readded it today at 18:54 it is not visible either. For me, the button always was there and still is there. The note I added today at 18:17 was visible on the image, but obviously it is not there anymore since you removed it a few minutes later at 18:53, which now makes useless the comment I made to Djampa on the Bistro. It would have been a useful information to know if the users who do not see the button could have seen that note. -- Asclepias (talk) 19:28, 8 January 2022 (UTC)
I've switched to your version of the note, but neither version works for me. (I had assumed that there were only whitespace differences between the two so I chose the older version, but the position, size, and dimy values are also different - those may be relevant. My mistake.)
What size does the image say it is? For me I see "Size of this preview: 800 × 520 pixels." and "Original file ‎(1,600 × 1,039 pixels, file size: 262 KB, MIME type: image/jpeg)" --Pokechu22 (talk) 19:40, 8 January 2022 (UTC)
The note is now visible again. The sizes of my preview and original are the same as yours. -- Asclepias (talk) 19:46, 8 January 2022 (UTC)

Same issue with me, for instance File:Matterhorn from Domhütte - 2.jpg is not showing any annotation nor any button, while this one does, tried in several browsers. Zach (Talk) 14:43, 10 January 2022 (UTC)

Je suis tombé sur d'autres photos qui n'ont pas de bouton :

Djampa (talk) 06:50, 11 January 2022 (UTC)

As far as I can track it down (tested on different hardware/browsers) it looks like commons only works (something important change in recent weeks?!) with the "vector" skin. I had trouble (strangely only sometimes) with other gadgets too and no matter which I deacivated or not, the only thing that looks to work, is switching to the skin "vector" (even the "clasic" seems to work until now ... if that breaks too, I'm done with commons, since I won't search the menus to get to my watchlist or contributions ...). --Mirer (talk) 08:03, 11 January 2022 (UTC)

I have the same problem: the add note-Button does not appear on File:Dusseldorf, Germany after one week of Royal Air Force bombing, June 1943 (27804339421).jpg (it worked before a new rotated version of the image was added), but does work on almost every File, like File:Hangrutsch Kestert 2021 2.jpg. Switching skins did not show any effect, nor did removing all pre-rotation image note information from the page. Can anybody help? --Joschi71 (talk) 18:10, 19 January 2022 (UTC)

I uploaded an image from Flickr (File:Kandersteg Church.jpg), successfully added an annotation, User:FlickreviewR 2 passed cc-by-sa-2.0, then... broken! Zach (Talk) 14:24, 3 February 2022 (UTC) Again, with File:Kandersteg Valley.jpg, the image annotator broke just after User:FlickreviewR 2 edit. Zach (Talk) 18:55, 3 February 2022 (UTC) UPDATE: I uploaded a cropped version a the file and now the image annotator works... totally fine. Zach (Talk) 19:15, 3 February 2022 (UTC)

I get this intermittently. And it will work fine on one image while being broken on another, and is uncorrelated to whether the image has existing annotations. - Jmabel ! talk 23:26, 11 February 2022 (UTC)

Is this page useful to something because I got the same problem as my predecessors, and no one seems to take it into account. Regards. LeoAlig (talk) 08:21, 4 March 2022 (UTC)
File:Chinese-operated Khmer-Vietnamese restaurant.jpg also broken. RZuo (talk) 16:25, 26 April 2022 (UTC)
File:Mao_Zedong_2.jpg also. RZuo (talk) 19:35, 16 October 2022 (UTC)
@Krinkle: are you still maintaining this? Fish bowl (talk) 01:47, 28 April 2022 (UTC)
I do not. I have in the past made changes to its source code as part of general clean up for all Commons gadgets. I do not consider myself especially familiar with this gadget and am not a maintainer of it. Krinkle (talk) 12:54, 28 April 2022 (UTC)
  • Same problem persists intermittently. One day, I see annotations normally, another day it's never shown. I'm editing from Russia, so there might be issues with accessing some Wikimedia servers - but then switching to not-yet-blocked VPN nodes does not change much. If it's a "day off", it's off in Sweden and Estonia alike. Retired electrician (talk) 16:20, 28 May 2022 (UTC)

Same problem here. I’ve tried my eight latest uploads with the following result:

Works with
File:Feldberg-Skimatten-ks01.jpg
File:Freistaat Flaschenhals Schild freigestellt.png (the 1:1 preview window does not show up here)
File:Dog face with vibrissae.jpg (the 1:1 preview window does not show up here)
Does not work with
File:Heidenhäuschen-gipfel-basaltfelsen.jpg
File:Ewiges Eis Dornburg Infotafel.jpg
File:Ewiges Eis Dornburg.jpg
File:Riesengebirge mit Schneegruben ks01.jpg
File:Grosser Feldberg 2022-05 ks01.jpg

"Does not work" means that the "Add a note" button does not appear at all.

Firefox 102.0.1 64bit, Kubuntu 22.04, no relevant plugins to affect this as far as I see.

--Kreuzschnabel 21:06, 26 July 2022 (UTC)

If you ask me, apparently it works perfectly on narrow portrait-oriented images, less perfectly (no preview popup) on nearly-sqare shaped or non-jpg images, and not at all on landscape oriented images. --Kreuzschnabel 21:11, 26 July 2022 (UTC)
@Jon (WMF): I have been having this problem intermittently for years. Mostly, it works, sometimes it does not. When loading an image in the browser (I use Firefox 103) and the image is finally displayed completely, it usually takes a few further moments (0,5 - 1 sec.) until the "Add a note" button shows up. Sometimes it will never show up - looks as if a process gets stuck. The files mentioned by Kreuzschnabel on July 26 work for me. The files mentioned by Djampa won't. In addition, for example File:Fagradalsfjall oli 2021177.jpg won't. I doubt that the image orientation is relevant. However, it seems to me as if smaller images (< 500 KBytes) may tend to make trouble more often. Perhaps it's a question of JPG compression? --Kuhni74 (talk) 13:04, 5 August 2022 (UTC)
I noticed that when I try editing e.g. the description of a problematic image immediately (few sec.) after loading the page, my browser will display the message "this page is asking you to confirm that you want to leave - data you have entered may not be saved". This message usually occurs when I'm entering data on a page and try to leave it without saving. This supports my theory that an editing process hangs. --Kuhni74 (talk) 15:07, 8 August 2022 (UTC)
This problem still remains --Kuhni74 (talk) 17:18, 10 October 2022 (UTC)

Hi everyone, I spend some time with debugging two example files with this problem in my environment with Windows and FF. Here is what i found out:

  1. File:Ladakh_(14480612459).jpg: Here the function img_check at the line with comment "Quit if the image wasn't loaded properly for some reason" returns null. The img.clientHeight=323 differed from srcH=324. Could be some rounding issue.
  2. File:Daniušava,_Vialla._Данюшава,_Вяльля_(1915-18)_(3).jpg: Here LAPI.WP.getPreviewImage located in MediaWiki:LAPI.js returns null. Maybe this is connected with the fact that the image has no generated thumbnails ("No higher resolution available.").

Maybe that helps someone to fix. --Arnd 🇺🇦 (talk) 16:12, 14 December 2022 (UTC)

@Aschroet: wow, this kind of analysis really sounds very helpful, although I don't understand the technical details. The rounding issue could be interesting, as well as the "no higher resolution" factor. Indeed, I observed that small images (that don't need other resolution versions) tend to produce the error more often. --Kuhni74 (talk) 09:26, 30 December 2022 (UTC)
I think that a part of the overall problem is just the fact that a lot of things have changed since ImageAnnotator was "finalized". Circa 2009-2010 importScript() was the best and recommended and only easy way to load an "external" script; this isn't really the case in 2023 and the standards have changed. The loading order and how things get (or don't get) loaded may cause some of the intermittent issues you're seeing.
A tangentially related issue I think the Commons community needs to address as a whole is seemingly simple yet devious: how old(/new) browsers are (not) supported by ImageAnnotator? MediaWiki:LAPI.js et al. have plenty of code to support browsers which'd be classified as super legacy these days (ancient Internet Explorers, old Operas, etc.); modern versions of MediaWiki don't even load JavaScript for such browsers, so there's a decent amount of optimization to be done there. (See also mw:Compatibility) I'd suggest that the ImageAnnotator JS should support MediaWiki versions up to the previous (but still currently supported) Long Term Support release, as outlined on mw:Version lifecycle.
Back in April-May 2022, I tried packaging ImageAnnotator as a more "proper" MediaWiki extension with some PHP parts and all. (Why? That's, uh, a very good question. On the other hand, the very beauty of ImageAnnotator is that it Just Works™ and doesn't require any server-side admin oversight to be installed, an on-wiki sysop can add the relevant lines of JS etc. to load ImageAnnotator on a wiki.) One of the many issues I ran into was the LAPI.WP.getPreviewImage one noted by @Aschroet: above. I fixed this by changing the line img = LAPI.WP.getPreviewImage( mw.config.get( 'wgTitle' ) ); to img = $( '#file img' )[ 0 ]; and that should be just fine for any MediaWiki version released within the past decade or so. (As per mw:jQuery, MediaWiki has included the jQuery library since MediaWiki 1.16 so depending on it is generally speaking totally fine. But of course ImageAnnotator literally predates MW's inclusion of jQuery, for MW 1.16 was released in 2011.) I'm not bold enough to claim that "this will definitely fix the issue(s) for sure", but I'd suggest giving it a go, maybe even wrapping it in a conditional of some kind to test or something. In the same setup_one method, I changed file_div = LAPI.$( 'file' ); to file_div = $( '#file' )[ 0 ]; but this may have just been additional paranoia on my part rather than something strictly necessary.
--Jack Phoenix (talk) 16:53, 3 January 2023 (UTC)
Image annotations do appear to be disabled if the image's actual size is smaller than the user's Image size limit on file description pages setting. (For example, a 1920x1080 image with an Image size limit… set to 2560x2048 will trigger this.) I guess it's to prohibit users from adding annotations to small images? But that's an issue for those with higher resolution monitors who want to use larger previews. A workaround is to reduce the Image size limit to something smaller than the actual image size, but in my opinion that's a bit kludgy, and will be a pain for the users with those high resolution screens. This restriction might be explained in the documentation somewhere, but I couldn't find it. I only found some small reference to this in the gadget code. In my humble opinion, this is a setting users should be able to toggle, at least. And mentioned in the docs.  🗨 desoda (Talk | Contributions) 23:26, 21 January 2023 (UTC)

No activation button in Vector 2022 skin

{{Edit request}} The activation button for the gadget shows up in the Vector 2010 skin but is invisible in my Vector 2022 skin.

As the 2022 version may become the standard skin in the foreseeable future a little tweaking may be necessary. The problem may not be with the script but with the skin.

(I'm unsure whether I am using the {‍{Edit request}} template correctly. I see it in Dutch localisation which suggests I will have to edit the .js file myself. I can't, I just want to point out the problem) → bertux 09:11, 9 October 2022 (UTC)

@Bertux Do you mean the “Add a note” button? (Add a note, Notitie toevoegen in Dutch.) I still see that button with ?useskin=vector-2022 in the URL on a file, and clicking it seems to work as well (though I haven’t tried to save an annotation yet). Lucas Werkmeister (talk) 10:00, 9 October 2022 (UTC)
Yes, that's what I meant. But now it is there; has anyone changed the skin? It's not just me, MartinD had probably the same issue, see Help talk:Image-Annotator#How do I add notes to existing files? → bertux 12:52, 9 October 2022 (UTC)
@Lucas Werkmeister: @Bertux: This may be related to the problems addressed in #No button "Add a note". --Kuhni74 (talk) 10:44, 11 October 2022 (UTC)
I just want to note for the record that, as a logged-in user, I'm seeing the "Add a note" button in the Vector 2022 skin (at least on the few images I tried, I normally use MonoBook everywhere). --Jack Phoenix (talk) 16:53, 3 January 2023 (UTC)

Image annotator bug?

I use the image annotator frequently and would probably much more if it would work correctly. I always have to perform a workaround in copying the text I introduced in the edit field in visual mode and then re-paste it in an other field in code as indicated if one has issues. I have reported that also to Kuhni74 who apparently is able to make annotations without the workaround. I also began a discussion on it at the Phabricator some months ago. Can anyone help? Paradise Chronicle (talk) 21:26, 1 February 2023 (UTC)

FYI, this page might be/probably is a better place for ImageAnnotator bugs than Phabricator, at least now. I wouldn't be opposed to having a dedicated "Gadget-ImageAnnotator" tag created for it at Phabricator, but at the same time, ImageAnnotator is primarily used on Commons (for obvious reasons!) so the threshold for reporting an issue with it should be as low as possible, and that can be achieved by not directing users to Phabricator.
As for the issue itself: I don't know why this is happening or why it would be happening to you but not to Kuhni74. (Well, I mean, I can look at the code and see that it happens when the gadget is trying to save an annotation and somehow the reply returned by the server does not contain what is expected. But why? Beats me!)
Just out of sheer curiosity and all, would you mind sharing:
  1. What skin you're using
  2. On what image(s) did you see the problem
I don't want to get your hopes up high, so I won't say "this will definitely be fixed by some given date", but rather I'll say that hopefully we can give ImageAnnotator some love this year to fix these kind of bugs. The ImageAnnotator codebase is about/over 13 years old, and a lot has changed in those years, hopefully for the better when it comes to gadgets. Thus I think it's possible to clean up the code and make it more robust than what it originally was by having it use MediaWiki's API interface instead of screenscraping, etc. --Jack Phoenix (talk) 01:50, 6 February 2023 (UTC)
@Jack Phoenix thank you very much for the reply. Well then lets give it a try.
1. I am using Vector 2010 but today I also tried it twice on Vector 2022 which will probably be the skin I'll also use in the future.
2. I had the problem on every image/file I tried to add annotations.
with the very best regards,
Paradise Chronicle Paradise Chronicle (talk) 07:14, 7 February 2023 (UTC)

missing annotations after a edit of SchlurcherBot

SchlurcherBot destroys the visibility of our annotions in many cases, like here in File:Hannover Rom -Luftaufnahmen- 2014 by-RaBoe 064.jpg (065, 066, 067 ...). they are only in the source code. @Schlurcher: Can we find out what happens and is a repair possible? maybe there is a solution for a similar disappearance of the annotations after a rotate and new upload with rotatebot (leider auch bei jedem anderen "verbessernden" Upload sind die Rähmchen unsichtbar bzw der Cursor kann den Untergrund nicht mehr erreichen). Files for an experiment are the many "tiff"-maps like File:Hippach und Wildgerlos-Spitze. NYPL1226653.tiff in Category:Spezialkarte der Osterreichisch-Ungarischen Monarchie (NYPL collection), new jpg uploads?, + 1 annotation on each file and then a "Slow SchlurcherBot" to analyse step by step the moment of the disappearance of an annotation? (ich bin kein Programmierer, aber vielleicht kann ein schrittweises Halbieren der "Programmierungszeilen" den Moment des Verschwindens eingrenzen helfen? zurücksetzen der SchlurcherBot-Bearbeitung hat leider nicht die Anmerkungen wiederhergestellt ... war schon viel Arbeit, die nun vorläufig verloren ist) LudwigSebastianMicheler (talk) 02:02, 9 March 2023 (UTC)

das etwa ist auch kaputt, das und das (anderer Autor der Anmerkungen) auch, manche die von SchlurcherBot aufgesucht worden sind jedoch nicht - ist schon gespenstisch. --LudwigSebastianMicheler (talk) 17:22, 13 March 2023 (UTC)
Mir erschienen die Annotationen der ersten zwei Bilder, File:Hochfeiler in Alps.jpg ist aber auch bei mir kaputt. Ich habe einen Fehler gefunden, hoffentlich wird jemand ihn bald korrigieren. – Tacsipacsi (talk) 20:18, 16 March 2023 (UTC)
Danke, Tacsipacsi. Ist damit dann auch der vielfach verschwundene "Add a note"-Button damit wieder sichtbar? bei diesem Bild hier (073) etwa sind sowohl die Anmerkungen (= annotations) als auch der Button verschwunden, SchlurcherBot war nicht beteiligt, doch @Kuhni74: hatte im Oktober 2022 noch Anmerkungen machen können, wär' schon schade, wenn die weg wären. bei einem ähnlichen Foto in der Serie (076) jedoch ist zumindest bei mir alles sichtbar ... --LudwigSebastianMicheler (talk) 20:35, 19 March 2023 (UTC)
Dieses Problem ist schon recht alt und ungelöst (siehe dieser hier leider archivierte Thread und User talk:Kuhni74#ImageAnnotator). Mit SchlurcherBot hat es meines Erachtens nichts zu tun. Es scheint beim Aufrufen mancher Bilder ein Prozess zu hängen, bevor der Button erscheint und die Annotationen angezeigt werden - sie sind technisch aber durchaus noch vorhanden. --Kuhni74 (talk) 08:09, 20 March 2023 (UTC)
Es gibt offensichtlich kein einzelnes „dieses Problem“ – File:Hochfeiler in Alps.jpg wurde (dank dieser Bearbeitung) bei mir repariert, File:Kalachakra 2014 (14676039504).jpg ist aber beispielsweise noch immer kaputt. – Tacsipacsi (talk) 19:15, 21 March 2023 (UTC)
In der Tat funktionieren jetzt manche Bilder wieder, die zuvor nicht funktioniert haben. Vielen Dank an wer auch immer an der Reparatur des codes nun schon beteiligt war. Mein Eindruck ist, dass insbesondere kleine Bilder (wenig Pixel und / oder wenig kB) gerne "hängen" aus welchem Grund auch immer. --Kuhni74 (talk) 10:20, 23 March 2023 (UTC)

Exception Error

Hi, I've been using this gadget for years, but since a few weeks I have been experiencing a bug (Vector 2022, Windows 10, Firefox).

  • When I want to add a note, firstly I preview it, whether the note is well formatted I save it.
  • Then a pop up appears with Exception Error: Version inconsistency after saving. Please reload the page.

It's a minor bug because the gadget is still working, the note has been saved, but it is annoying. Pạtạfisik 10:43, 14 April 2023 (UTC)

Input popup should be moved further down and right if possible

try the existing note on File:2020 廣州逢源坊.jpg for example. the input popup covers part of the selected area. it seems i cant drag and move it out of the way. this makes it difficult to transcribe texts.

usually, there is blank space to the right of the image, so the popup can be moved further to the right without impeding anything. RZuo (talk) 12:14, 10 May 2023 (UTC)

Why break into a new line?

again, the note on File:2020 廣州逢源坊.jpg is only 5 kanjis and 1 ascii colon long. that's a pretty short string, but the last kanji is moved to a new line. something about line wrapping can be improved. RZuo (talk) 12:16, 10 May 2023 (UTC)

Is it possible to force the magnifier to always show up?

while editing File:2020 廣州逢源坊.jpg, the magnifier shows up. i love it and want to have it regardless what image i'm editing. i guess there's some setting in the code to conditionally show this. maybe add a setting to let users opt in to have the magnifier always enabled? RZuo (talk) 12:19, 10 May 2023 (UTC)

Special directions of text

things to consider supporting:

  1. rtl text, e.g. File:萬國戲院招牌.jpg.
  2. vertical text, e.g. File:HK WCN 灣仔北 Wan Chai North 君悅酒店 Grand Hyatt Hotel 華藝國際 香港拍賣 Holly's Int'l Auction preview 中國書法 古畫 Chinese calligraphy n painting November 2022 Px3 50.jpg.

--RZuo (talk) 13:24, 23 June 2023 (UTC)

@RZuo: I'm not sure I understand — image annotations are just notes attached to rectangular areas of an image. So, you can already annotate any feature (including the text) in either of those images. Simply draw a box around the area of interest, and add a note in the annotation field provided. FeRDNYC (talk) 02:35, 13 July 2023 (UTC)
However, note also what Commons:Image annotations says about transcriptions:
Examples of informative notes
  • transcribing inscriptions, signs, or words in the image. Examples: 1, 2. If the entire image is a sign or an inscription, this should be done in the {{Information}} template only. This can be useful with hard-to-read or -notice signs. It allows text translations and can allow search engines to find the image based on such text.
FeRDNYC (talk) 02:47, 13 July 2023 (UTC)
using File:萬國戲院招牌.jpg as an example, what i meant was, on the image you see "院戲林大", which should be read rtl. so when i put an annotation, i would put down {{zh-hant|大林戲院}} in the natural (correct) order.
what i want is, i could set this to appear rtl.
it's helpful to use annotations to label these transcriptions on the image. putting all transcriptions in info template is difficult to show the users which is which, especially if there are multiple texts on the image. RZuo (talk) 08:05, 13 July 2023 (UTC)