Posts: 1,529
Threads: 70
Joined: May 2021
Reputation:
167
Operating system(s):
Gimp version: 2.10
04-24-2023, 03:56 AM
(This post was last modified: 04-24-2023, 04:34 AM by PixLab.)
Jeeezzz, I would have never ever thought I would say that one day ?
I'm preparing a tutorial, and I just want to see if it's compatible with Windows without me going to some tricky thing for that OS
What I need you to do:
Create a folder, put a little png inside, name it myimage.png
Open CMD or powershell from that folder, or cd in/to it
and input that code (copy paste if you named your png as "myimage.png")
Code:
for i in {00..10}; do cp myimage.png file-$i; done
This code will make 10 copy of your image inside that folder, BUT, and I say BUT, there should be NO extension (like ".png") on the 10 copies, I know that the Microsoft's windows OS is incapable to manage file without extension (maybe in this case it will add the extension automatically? or keep the original one? I don't know)
Case 1:
Windows throw errors as it will not accept to write without extension = no copies > Please report
Case 2:
Windows add an extension automatically or keep the original extension, you have copies with extension with something like "00.png" "01.png" "02.png" etc... > Please report
Case 3: (the one I'm interested in)
Windows does it, even it's not happy, you got the copies WITHOUT extension, but your explorer is not showing the thumbnail, that's OK > your files are named like this "00" "01" "02" etc...
If so > Open GIMP, import all file without extension > as layers > Does GIMP on Windows open them? Please Report
Thank you (you can delete that folder now)
Note: You might think "but what the.. is wrong to have the extension"
- Nothing, but for this very tuto, if it can via terminal I don't have to make some special tricks just for Windows, thus the tuto will be WAY shorter (and yes it's a GIMP tuto even if it sounds strange )
Posts: 1,529
Threads: 70
Joined: May 2021
Reputation:
167
Operating system(s):
Gimp version: 2.10
04-24-2023, 07:44 AM
(This post was last modified: 04-24-2023, 07:46 AM by PixLab.)
I did accessed a Windows machine, problem solved, it will be for Linux/MacOS only
Windows did not understood and throw errors, then I discovered that Microsoft's Windows does not have Python installed, When I wrote "Python" in "power"shell to activate it, the app-store opened proposing to install Python 3.11
Posts: 6,362
Threads: 276
Joined: Oct 2016
Reputation:
565
Operating system(s):
Gimp version: 3.00RC1
04-24-2023, 08:12 AM
(This post was last modified: 04-24-2023, 08:12 AM by Ofnuts.)
(04-24-2023, 07:44 AM)PixLab Wrote: I did accessed a Windows machine, problem solved, it will be for Linux/MacOS only
Windows did not understood and throw errors, then I discovered that Microsoft's Windows does not have Python installed, When I wrote "Python" in "power"shell to activate it, the app-store opened proposing to install Python 3.11
You can use Python from Gimp's Python console. And IIRC the copy command in BAT is copy (and could be something entirely different in PowerShell, because Microsoft).
Posts: 1,048
Threads: 87
Joined: Aug 2018
Reputation:
83
Operating system(s):
- Windows (Vista and later)
Gimp version: 2.10
04-24-2023, 11:54 AM
(This post was last modified: 04-24-2023, 12:20 PM by Krikor.)
(04-24-2023, 03:56 AM)PixLab Wrote: Jeeezzz, I would have never ever thought I would say that one day ?
I'm preparing a tutorial, and I just want to see if it's compatible with Windows without me going to some tricky thing for that OS
What I need you to do:
Create a folder, put a little png inside, name it myimage.png
Open CMD or powershell from that folder, or cd in/to it
and input that code (copy paste if you named your png as "myimage.png")
Code:
for i in {00..10}; do cp myimage.png file-$i; done
This code will make 10 copy of your image inside that folder, BUT, and I say BUT, there should be NO extension (like ".png") on the 10 copies, I know that the Microsoft's windows OS is incapable to manage file without extension (maybe in this case it will add the extension automatically? or keep the original one? I don't know)
Case 1:
Windows throw errors as it will not accept to write without extension = no copies > Please report
Case 2:
Windows add an extension automatically or keep the original extension, you have copies with extension with something like "00.png" "01.png" "02.png" etc... > Please report
Case 3: (the one I'm interested in)
Windows does it, even it's not happy, you got the copies WITHOUT extension, but your explorer is not showing the thumbnail, that's OK > your files are named like this "00" "01" "02" etc...
If so > Open GIMP, import all file without extension > as layers > Does GIMP on Windows open them? Please Report
Thank you (you can delete that folder now)
Note: You might think "but what the.. is wrong to have the extension"
- Nothing, but for this very tuto, if it can via terminal I don't have to make some special tricks just for Windows, thus the tuto will be WAY shorter (and yes it's a GIMP tuto even if it sounds strange )
I'll try, but I'm not sure I understand what needs to be done.
Report after trying.
Did not work.
It returned:
i was unexpected this time.
.....
Samj Portable - Gimp 2.10.28 - Win-10 /64.
Posts: 1,529
Threads: 70
Joined: May 2021
Reputation:
167
Operating system(s):
Gimp version: 2.10
04-24-2023, 12:59 PM
(This post was last modified: 04-24-2023, 01:03 PM by PixLab.)
(04-24-2023, 08:12 AM)Ofnuts Wrote: You can use Python from Gimp's Python console. And IIRC the copy command in BAT is copy (and could be something entirely different in PowerShell, because Microsoft).
Thanks you very much Ofnuts for your input, I'll look into it, I do recall what's a .bat file, but it was something like in 2010 the last time I did have a Windows system, so I need to look further into it, and thanks for the reminder about BAT, I did completely forgot it.
(04-24-2023, 11:54 AM)Krikor Wrote: I'll try, but I'm not sure I understand what needs to be done.
Report after trying.
Did not work.
It returned:
i was unexpected this time.
Thank you Krikor for your try, very much appreciated your input, this afternoon I did have an access to a Windows computer where I work, and I saw too much problem with powershell.
I'll look deeper into the Ofnuts "bat" suggestion and the GIMP command line options, but my mind already kind of find a way (not so pretty, I mean less straight forward) for windows users, thus the tuto should be for all platform if I found the command to rename a bunch of file on windows (I'll search for it tomorrow, it's quite night now where I live, I think Tas_mania understand as I think we are on the same time zone or similar (GMT +8) )
In all cases thanks a lot guys, very much appreciated.
Posts: 6,362
Threads: 276
Joined: Oct 2016
Reputation:
565
Operating system(s):
Gimp version: 3.00RC1
(04-24-2023, 12:59 PM)PixLab Wrote: (04-24-2023, 08:12 AM)Ofnuts Wrote: You can use Python from Gimp's Python console. And IIRC the copy command in BAT is copy (and could be something entirely different in PowerShell, because Microsoft).
Thanks you very much Ofnuts for your input, I'll look into it, I do recall what's a .bat file, but it was something like in 2010 the last time I did have a Windows system, so I need to look further into it, and thanks for the reminder about BAT, I did completely forgot it.
(04-24-2023, 11:54 AM)Krikor Wrote: I'll try, but I'm not sure I understand what needs to be done.
Report after trying.
Did not work.
It returned:
i was unexpected this time.
Thank you Krikor for your try, very much appreciated your input, this afternoon I did have an access to a Windows computer where I work, and I saw too much problem with powershell.
I'll look deeper into the Ofnuts "bat" suggestion and the GIMP command line options, but my mind already kind of find a way (not so pretty, I mean less straight forward) for windows users, thus the tuto should be for all platform if I found the command to rename a bunch of file on windows (I'll search for it tomorrow, it's quite night now where I live, I think Tas_mania understand as I think we are on the same time zone or similar (GMT +8) )
In all cases thanks a lot guys, very much appreciated.
Windows users are ... windows users. A .bat? What is that? I have seen these people (and this is the part that makes it to an engineering school and Pr. Ofnuts' Advanced Java Programming class) calling the command prompt a "black screen", which hints at the terror that hits them when they have to use it. So don't put too much hope in a tutorial that uses these concepts.
Posts: 1,148
Threads: 178
Joined: Sep 2018
Reputation:
114
Operating system(s):
- Windows (Vista and later)
Gimp version: 2.10
Posts: 1,529
Threads: 70
Joined: May 2021
Reputation:
167
Operating system(s):
Gimp version: 2.10
(04-24-2023, 03:15 PM)Ofnuts Wrote: So don't put too much hope in a tutorial that uses these concepts.
Yes, indeed, still try to find something more suitable to Windows users, thank you Ofnut
(04-24-2023, 05:43 PM)denzjos Wrote: Bat files in windows are batch files and a DOS legacy from the past. Maybe this can help you:
https://www.windowscentral.com/how-creat...windows-10
https://www.tutorialspoint.com/batch_scr...ctions.htm
https://www.minitool.com/news/create-and...-file.html
Thanks @denzjos, I'm going to take a look
Posts: 7,137
Threads: 155
Joined: Oct 2016
Reputation:
1,006
Operating system(s):
Gimp version: 2.10
04-30-2023, 01:22 PM
(This post was last modified: 04-30-2023, 01:24 PM by rich2005.)
Maybe something like this
Code:
@echo off
copy test.png /B test
set /A "index = 1"
set /A "count = 10"
:while
if %index% leq %count% (
copy test test%index%
set /A "index = index + 1"
goto :while
)
del test
Imgur not processing video at the moment so, https://filedn.com/lkb9dw6mEfXSsOu9uKLaM14/2.mp4
Has the 'magick' number so opens in Gimp even without .png extension
Posts: 1,529
Threads: 70
Joined: May 2021
Reputation:
167
Operating system(s):
Gimp version: 2.10
05-02-2023, 01:17 AM
(This post was last modified: 05-02-2023, 01:18 AM by PixLab.)
(04-30-2023, 01:22 PM)rich2005 Wrote: Maybe something like this
Code:
@echo off
copy test.png /B test
set /A "index = 1"
set /A "count = 10"
:while
if %index% leq %count% (
copy test test%index%
set /A "index = index + 1"
goto :while
)
del test
Imgur not processing video at the moment so, https://filedn.com/lkb9dw6mEfXSsOu9uKLaM14/2.mp4
Has the 'magick' number so opens in Gimp even without .png extension
Woww, thanks a lot @rich2005
I will try the code tomorrow (today I cannot access a Windows machine)
But I think I got a big XY problem (sorry ), I might need the extension after all (because of a "bug" in G'MIC, not a bug as bug... but something happens with the last period/dot in the naming when I change channel in G'MIC)
Thus after duplication, I would like to rename them depending a list.txt > https://i.imgur.com/TG1RHpL.png
on Linux I would just do
Code:
for file in *.png; do read line; mv -v "${file}" "${line}"; done < pricelist.txt
And all the file will be renamed like this > 20 second video https://imgur.com/6QuCw9Z
I try not to tell too much about the tuto to keep the "surprise" (although I'm sure that you and Ofnuts knows what it will be about, because of reddit)
|