MediaWiki talk:Gadget-ImageAnnotator.js
![]() | MediaWiki:Gadget-ImageAnnotator.js forms part of the MediaWiki interface and can only be edited by administrators, stewards and interface editors. To request a change to MediaWiki:Gadget-ImageAnnotator.js, add {{Edit request}} to this talk page, followed by a description of your request. |
To see all annotated images, visit Category:Images with annotations.
![](https://upload.wikimedia.org/wikipedia/commons/9/99/Page_paste.png)
|
Conversations older than 7 days will be archived automatically. |
![]() |
edit this list - add to watchlist - purge | |
---|---|---|
None of these need to be fixed immediately, but they should be looked at eventually. |
![]() |
![]() |
![]() |
![]() |
![]() |
Annotation shapes
[edit]I don't quite understand the argument (in Help:Image-Annotator#Frequently asked questions) that other annotation shapes are "not possible". Consider, for example, this screenshot I just took: https://imgur.com/a/n8JFClM. As the caption says, that circular annotation was created by simply adjusting the CSS properties for the annotation <div>...</div>
s: equal height and width, a positioning correction so that its center point is the same, and a ridiculously high border-radius
value. Common trick. I'm sure css-tricks can offer plenty more.
I'm not saying annotations should go crazy with custom shapes, but I can certainly see how having at least circular ones could be useful, and those are ridiculously easy. FeRDNYC (talk) 03:30, 13 July 2023 (UTC)
- Border-radius is not a solution – the argument is not about the impossibility of displaying non-rectangular annotations, but the impossibility of creating them. However, the point about issues in IE8 and lower doesn’t apply anymore – not even IE11 gets JavaScript nowadays. I don’t know what is meant by
considerable difficulty using the <canvas> element of HTML5
, but I assume it means this is still notridiculously easy
, although probably no longer entirely impossible. —Tacsipacsi (talk) 11:36, 15 July 2023 (UTC)
Worst gadget
[edit]![](https://upload.wikimedia.org/wikipedia/commons/thumb/a/ae/Error_and_bad_UI.png/220px-Error_and_bad_UI.png)
This thing needs a top-to-bottom re-creation. I wish I knew how to code because I'd do it myself. I can never get the tool to appear to allow me to create new notes, and existing notes often don't show. And even when I do create new notes, it doesn't let me save them, so I need to paste in the wikitext and save it. And then there's the fact that making small note boxes is ridiculously difficult. And the whole user interface feels like something out of Windows 98. Should this be a Community Wishlist entry? ɱ (talk) 21:14, 27 August 2023 (UTC)
- I'd support that. To me the image annotator appears selectively and randomly and if it appears only functions with the workaround you also use. Paradise Chronicle (talk) 21:18, 8 September 2023 (UTC)
- But I'd like to add that it is a great gadget, it just has a disfunction. The idea of it is great. Paradise Chronicle (talk) 07:44, 5 October 2023 (UTC)
- User:Ɱ, User:Paradise Chronicle: Turned out this is that old that needs VisualEditor for wikitext edits be disabled from the preference ("Use the wikitext mode inside the visual editor, instead of a different wikitext editor" option) to work properly because it relies on things before introduction of edit API in MediaWiki understandably because being that old, it's a miracle by its own that some of it's functionalities are still working. I've fixed two issues from the script but haven't found a fix for this one that won't need changing the script too much (was imagining something appending ?disablevisualeditorforwikitext=1 to the editor), so considering the importance of the script some help would be nice I believe (cc: User:Krinkle, User:Matma Rex, User:Jarekt sorry for the spam feel free to ignore if you aren't interested) −ebrahimtalk 19:05, 9 June 2024 (UTC)
- @Ebrahim You can use
&action=submit
parameter instead of&action=edit
to open the old wikitext editor regardless of user preferences (mw:Manual:Parameters_to_index.php#submit). Matma Rex (talk) 21:27, 9 June 2024 (UTC)- @Matmą Rex: Wow, what a solution, just applied it and it made annotator to work again! Thanks! −ebrahimtalk 06:57, 10 June 2024 (UTC)
- Dear Ebrahim, you are very, very helpful. I've had this issue since years, opened several discussion about it, suggested an update to it in the annual tech survey and now you turn up with this very simple solution. Just, wow. Paradise Chronicle (talk) 11:06, 14 June 2024 (UTC)
- User:Paradise Chronicle: Thank you 😊 −Ebrahimtalk 08:53, 26 June 2024 (UTC)
- Happy to see this tool back to life. -- ZandDev (talk) 13:44, 30 June 2024 (UTC)
- User:Paradise Chronicle: Thank you 😊 −Ebrahimtalk 08:53, 26 June 2024 (UTC)
- @Ebrahim You can use
- I do not read javascript so can not help with the code, but I agree with User:Ɱ and User:Paradise Chronicle that this great app could use "top-to-bottom re-creation". User:Ebrahim and User:Matma Rex, thanks for pathing it up. I did a lot of testing of the early version of the app when user:Lupo was working on it and has been a fan ever since. One issue with the app I find frustrating is that reuploading a new version of the file (with slightly altered dimensions) makes all annotations invisible since all the boxes are stored in pixel coordinates. User:Lucas Werkmeister's Positions Wikidata Image Positions tool was designed to store the box coordinates as fractions of the image in SDC properties ( relative position within image (P2677) ) and does not have that issue, so maybe any rewrite should be a merging of both tools. --Jarekt (talk) 12:45, 10 June 2024 (UTC)
- User:Jarekt: Very interesting point, thanks for sharing. −ebrahimtalk 14:55, 10 June 2024 (UTC)
- User:Jarekt: I just spotted the issue you were mentioning about annotations to fail to appear when images are updated with improved version so I fixed it with this change and it apparently works according to my test but not sure if nothing else got broken or not so feel free to test if is possible. It of course ensures the picture ratio isn't changed that much (the change is less than 1%) otherwise it won't show the annotations, though, this can be relaxed. Thanks! −Ebrahimtalk 14:30, 23 June 2024 (UTC)
- User:Ɱ, User:Paradise Chronicle: I've requested the rewrite as a community wishlist m:Community Wishlist/Wishes/Rewrite ImageAnnotator or integrate it into MediaWiki WikibaseMediaInfo and I specially used your information about that Wikidata property User:Jarekt. −Ebrahimtalk 05:32, 22 July 2024 (UTC)
Annotations not showing
[edit]I am unable to see notes or the "add a note" button that I added to File:Coleman_Bangalore_entomologists.jpg but things work fine at File:Coleman_group_agriculture_diploma.jpg. Shyamal L. 13:11, 6 July 2024 (UTC)
- I see both the notes and the “add a note” button on both images. See w:WP:JSERROR for how to provide information useful for determining what’s gone wrong. —Tacsipacsi (talk) 00:49, 7 July 2024 (UTC)
- I confirm the above report. But, annotations are not shiowing on both of the images the contributor linked. The annotations on another particular image used to show for me a few months ago but not today. In the console, I get:
Error: View mediainfoview does not exist _getView ViewFactory.js:702 getEntityView ViewFactory.js:219 createEntityView wikibase.ui.entityViewInit.js:146 mightThrow jQuery createEntityView wikibase.ui.entityViewInit.js:139 js wikibase.ui.entityViewInit.js:410 _getDeserializer wikibase.EntityInitializer.js:103
- -- Wesha (talk) 17:24, 9 August 2024 (UTC)
- I see the above error message and the image notes and the new note button on File:Coleman Bangalore entomologists.jpg, so it’s unlikely to be the culprit (unless it depends on the timing). By the way, this error message is phab:T321532. —Tacsipacsi (talk) 09:34, 14 August 2024 (UTC)
- -- Wesha (talk) 17:24, 9 August 2024 (UTC)
img src dimensions off by 1 error
[edit]Can the line:
if ( w != srcW || h != srcH ) {
be replaced with
if ( w != srcW || Math.abs( srcH - h ) > 1 ) {
Sometimes image dimensions get rounded, so it is not totally unusual for the height calculation to be off by 1. An example of such a file is File:SR_Technics_hangar_at_Zurich_International_Airport.jpg, where you will notice (assuming your preference for image sizes on file desc pages is 800x600) $( '#file img')[0].getAttribute( 'height')
is 458 but $( '#file img')[0].clientHeight
is 457. Bawolff (talk) 15:20, 17 July 2024 (UTC)
Done --Lucas Werkmeister (talk) 21:56, 17 July 2024 (UTC)
- Thanks. Hmm, it still doesn't work on minerva on narrow screens where images get dynamically resized. Maybe it makes sense to get rid of this check entirely and just verify the client dimensions aren't 0 and roughly the right aspect ratio, or something like that. Bawolff (talk) 18:00, 18 July 2024 (UTC)