Forum › Forums › General › Software › Bug in antiX screenshot tool from main menu, loss of data possible
- This topic has 19 replies, 6 voices, and was last updated Jan 31-12:16 pm by anticapitalista.
-
AuthorPosts
-
January 24, 2021 at 2:45 pm #50635Member
Robin
Warning: beware of Data loss
Please be aware that this tool, which works great in all other aspects, seems to have a problem, which leads to screenshots get lost completely in case filename entered is longer than 255 characters.
While SpaceFM file manager gives a warning when this most common limit of filename length for linux systems in general is infringed, the screenshot tool found in anitX main menu (section programs/graphic) does not. It comes up happily with a message window like “Screenshot was saved successfully” (original: “Ihr Bildschirmfoto wurde gespeichert” but I have the German language version present only, so I can’t tell the exact English phrase for sure in the moment), when you accidentally enter 256 or more characters, but the screenshot will never get saved. I experienced this right now and lost some twenty screenshots taken sequently, and after all work was done there were missing most of the files, putative without any reason. Some researching unsheathed they didn’t get saved at all due to filename exceeded limits without notice, and the screenshot program returns wrong success message nevertheless.
I can’t tell whether this bug has got fixed in new versions of antiX already. This report is valid for 17.4.1 antiX x86 32bit i686 full, apt-get update && apt-get upgrade applied recently.Windows is like a submarine. Open a window and serious problems will start.
January 25, 2021 at 9:08 pm #50793MemberRobin
::Dropping a provisional fix for this problem preventing users from saving their screenshots to nowhere while getting misinformed by the underlying script at least. Works on 17.4.1, needs to be tested on 19.x series.
- This reply was modified 2 years, 3 months ago by Robin.
- This reply was modified 2 years, 3 months ago by Robin.
Attachments:
Windows is like a submarine. Open a window and serious problems will start.
January 25, 2021 at 9:45 pm #50801Member
Xecure
::Compare it with the code in the gitlab project (https://gitlab.com/antiX-Linux/screenshot-antix) and create a merge request there.
Most things written in the forum are forgotten (everyone has busy lives), so it is better to go directly to the source and send a fix proposition there.
antiX Live system enthusiast.
General Live Boot Parameters for antiX.January 25, 2021 at 9:49 pm #50802Anonymous
::tested (in 17.4)
Thanks for the contrib.
Please consider a further mod. Spare the user an extra click on Success; only display a dialog in the event of error.January 25, 2021 at 10:58 pm #50813MemberRobin
::Spare the user an extra click on Success
For this you might simply add “–timout =5” to line 98 in the attached version from above, so it reads afterwards:
yad --title="antiXscreenshot" --timeout=5 --image="info" --text=$"Your screenshot has been saved."
so the message window will vanish within some seconds, and user still will get informed that script didn’t crash accidentally but has done its job correctly. In case of error I think user better should confirm by clicking.I noticed some other things which could be improved (could I try to improve) within this script. This will take some time, but I’ll not forget.
Compare it with the code in the gitlab project (https://gitlab.com/antiX-Linux/screenshot-antix)
Yes, I’ll check this and use what I’ll find there. Thank you for heading me to the right place, I wouldn’t have known where to search. I generally use the files found on the pc running, starting the modifications/corrections from this point.
Please keep in mind I’m not a programmer but have only some knowledge about the language structures found in scripts and programs which allows me to fix and even (re)write the code as long as it is not object oriented. And I have not the faintest idea how to work with places like github or a repository structure behind scenes.
create a merge request there.
I simply neither don’t know how this could be done nor do I have access to it. So I’ll have to stick to the detour via forum for some time.
- This reply was modified 2 years, 3 months ago by Robin.
Windows is like a submarine. Open a window and serious problems will start.
January 26, 2021 at 1:18 am #50828Anonymous
::> I’m not a programmer but have only some knowledge about the language structures
same here, no formal programming education. I’m a naive programmer, a codemonkey, a meat popsicle
.FWIW, before submitting the earlier post, I had (unsuccessfully) tried adding –center to each of the yad calls
and feh –scale down (centering, but only effective w/ tiling WMs)January 26, 2021 at 1:48 am #50832Anonymous
::don’t know how this could be done nor do I have access to it.
found this git onboarding post, and the instructions really haven’t changed since then
or
are even less complicated than they sound in that post
https://www.antixforum.com/forums/topic/to-modernize-antix-or/page/4/#post-23246Visit gitlab.com in web browser.
Click register.
Accept the gitlab confirmation email.
login to the gitlab.com siteAnalagous to the way files are organinzed directories on a drive
( or, a better analogy, how user home directories are organized under /home )
if your registered username is “itchyscratchy”, your homepage on the gitlab site would be
http://gitlab.com/itchyscratchy/Clicking “New Project”, and naming it “gogogo” will create a subdirectory in the gitlab.com namespace
and its homepage (the homepage of the project’s git repository) would be
https://gitlab.com/itchyscratchy/gogogo/While (logged into gitlab and) visiting the page of any existing project, you can click “Fork this project”.
If you would fork, say, gitlab.com/antix-linux/screenshot-antix/
____________________________Whoa, take a step back to explain:
I foundabug in the screenshot script
and
$ locate antixscreenshot
/usr/local/bin/antixscreenshot.sh
and
I fixed the bug and want to pass back the fixed version$ dpkg -S /usr/local/bin/antixscreenshot.sh
screenshot-antix: /usr/local/bin/antixscreenshot.sh
____________________________If user itchyscratchy forks
gitlab.com/antix-linux/screenshot-antix/
doing so will create a copy, owned by itchyscratchy, and accessible via:
https://gitlab.com/itchyscratchy/screenshot-antix/and, right within your web browser, you can edit the content of the existing files, create and/or upload new files…
when you are ready, not necessarily during all in a single browsing session,
click “Merge Requests”
and choose, as the destination, the project which you had forked when creating your copy.
Type ten words (?) to describe the changes you’ve made + Click the submit button. Done. Pizza time.January 29, 2021 at 5:31 pm #51075MemberRobin
::hello skidoo,
I understand I definitely will have to learn how this all works, understand the meaning of terminology before starting with it. Thank you very much for your explanations. I’ll have to read the manuals still, and I’m looking forward to master it within next weeks/months.
For now I have to apologise, since the antixscreenshot version above was tar’d from a pre-version for some reason, not the final one I had intended to upload. So that one won’t work.
Here comes the correct bugfix version (moreover I just added your suggestion to save user a click to acknowledge on success.). As soon as I can make it, I’ll put it to gitlab also. Maybe I will have done some further improvements by the time.Attachments:
Windows is like a submarine. Open a window and serious problems will start.
January 29, 2021 at 6:54 pm #51091Moderator
Brian Masinick
::Thanks skidoo for sharing the way to obtain a
- gitlab.com
account, name the account, create software and then merge it with an existing project, in this case antix-linux. While it’s possible to find this out, it’s useful for those who are eager to contribute to see a straightforward way to do so.
--
Brian MasinickJanuary 30, 2021 at 6:50 pm #51182MemberRobin
::SERIOUS WARNING! BEWARE OF DATA LOSS of previously existing files when using antixscreenshot.
Before using antixscreenshot make ABSOULTELY SURE you don’t have any important content in a folder named
~/scr(within your home directory) you once might have created on your disk before accidentally. All content and the folder itself will be deleted without notice by the program as of version antiX 17.4.1 which is identical to the actual code found on gitlab for recent antiX (19.x).I stumbled upon this serious risk by reviewing the code while learning how to upload the fix from above to gitlab, and of course I will fix this new one in one go.
For people in urgent need of the fix I’ll attach the fixed script once more for this time again. Hopefully next improvements will go to gitlab directly, if I can make it. Committing something to gitlab might not be a big deal for a real programmer, but I feel quite lost between all these switches and requirements in their “cockpit”. Well, over the course of time I’ll learn to cope with gitlab also in the end.
- This reply was modified 2 years, 3 months ago by Robin.
Attachments:
Windows is like a submarine. Open a window and serious problems will start.
January 30, 2021 at 7:38 pm #51185MemberRobin
::@skidoo
could you please assist me creating the merging request for these two bugfixes? I don’t get through the process on gitlab. Tried different ways, getting nothing but error messages always. Reading the Manuals didn’t help either. Trying now for nearly an hour, all in vain. It looks like I cant chose “anticapitalista antiX-linux” as target for some reason. When I enter it, gitlab system will replace my target choice automatically with my own klone and then it complains that source and target are to be different. How crackbrained is this?Attachments:
Windows is like a submarine. Open a window and serious problems will start.
January 30, 2021 at 7:56 pm #51187Forum Admin
Dave
::I think you are trying to make the source and the destination the same location. From the position in your screenshot; It looks like you only need to press compare and continue.
Are you making the merge request from your own account or trying through the antiX-Linux account. It should be done from your own account.Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown
January 30, 2021 at 8:01 pm #51188Member
Xecure
::Isn’t the scr folder created and then deleted while the screenshot app is open? No other app uses the ~/scr folder, and I have always seen it been created and then disappear once the screenshot is done and saved. Maybe you are expecting the files to instead be created in the /tmp folder instead of scr? Does any other app use this scr folder?
antiX Live system enthusiast.
General Live Boot Parameters for antiX.January 30, 2021 at 9:07 pm #51199MemberRobin
::@Dave I started from my own account after committing the fixes to the
fork“klone” I previously had started (https://gitlab.com/Robin-antiX/screenshot-antix) I clicked on “merge requests” from menu on the left side, then clicked green button “new request”. Then I’ve chosen as source “Robin-antiX/screenshot-antix”. But it seems I can’t chose “anticapitalista/screenshot-antix” as target. This target always gets replaced by “Robin-antiX/screenshot-antix” automatically after pressing “compare branches and continue”, so I have no clue what’s going on there. As described already, gitlab complains then about source and target have to be different. What the heck?
(I followed these instructions: https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html#new-merge-request-from-a-fork)@Xecure
Does any other app use this scr folder?
It doesn’t need to be a program necessarily, which uses the foldername already. We have users, which is enough to cause some trouble 😉
Isn’t the scr folder created and then deleted while the screenshot app is open?
Exactly this is the problem. Since it is a normal folder within users home directory, he might have created this folder, full with personal stuff already, having chosen this name for some reason. We can’t know. The script will delete all contents.
What I did was: Adding a test whether folder exists already and appending a random number to folder name in this case. So we can safely delete it afterwards. Thus we don’t need to use /tmp folder, but yes, we could. Good idea.- This reply was modified 2 years, 3 months ago by Robin.
- This reply was modified 2 years, 3 months ago by Robin.
- This reply was modified 2 years, 3 months ago by Robin.
Windows is like a submarine. Open a window and serious problems will start.
January 30, 2021 at 10:09 pm #51205Anonymous
::Robin, I see that your merge request has succeeded (as of 2 minutes ago, when I read this and checked)
https://gitlab.com/antiX-Linux/screenshot-antix/-/merge_requestsA few weeks ago, I ran into an identical scenario (would not allow me to choose the destination branch).
Frustrating and (but) I don’t recall the specifics. Walked away and tried again the next day ~~ no problem. -
AuthorPosts
- You must be logged in to reply to this topic.
