How can you add vertical text in batch using the filename.

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Robin55
Posts: 36
Joined: 2018-03-19T15:29:46-07:00
Authentication code: 1152

Re: How can you add vertical text in batch using the filename.

Post by Robin55 »

Still not working I'm afraid smibgo

I did exactly as you said and the CMD windows seems to be doing something though the speed the script goes by is very fast much faster than if it was really processing something. When it stops I just have the Command window at C: with a flashing dash?

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How can you add vertical text in batch using the filename.

Post by snibgo »

Robin55 wrote:Still not working I'm afraid smibgo
How do you know it isn't working? What is it doing, or not doing, that make you say "still not working"?

You can scroll the window up to read what is written. Are there any error messages? If so, what are they?
snibgo's IM pages: im.snibgo.com

Robin55
Posts: 36
Joined: 2018-03-19T15:29:46-07:00
Authentication code: 1152

Re: How can you add vertical text in batch using the filename.

Post by Robin55 »

Of course I should of thought of that. Here is a screen shot....https://ibb.co/DkTzbmQ

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How can you add vertical text in batch using the filename.

Post by snibgo »

Okay, so you have an error message:
se C=!strNq:~518,1!
The input line is too long
Insert this line at the top of your script:

Code: Select all

setlocal enabledelayedexpansion
snibgo's IM pages: im.snibgo.com

Robin55
Posts: 36
Joined: 2018-03-19T15:29:46-07:00
Authentication code: 1152

Re: How can you add vertical text in batch using the filename.

Post by Robin55 »

Thanks for your efforts so far snibgo :)

This is the error message I am getting now..https://ibb.co/tQFrvRp

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How can you add vertical text in batch using the filename.

Post by snibgo »

That looks better. It isn't showing your Japanese characters properly. I guess you are not using the correct codepage ("chcp" command).

It also doesn't seem to be calling "magick". I don't know why. Scroll further back: what does it say? Please paste your complete script here.
snibgo's IM pages: im.snibgo.com

Robin55
Posts: 36
Joined: 2018-03-19T15:29:46-07:00
Authentication code: 1152

Re: How can you add vertical text in batch using the filename.

Post by Robin55 »

I don't know what just happened but all of a sudden I can not use the CMD prompt. It's blank. And when I click on my bat file it says this program can not run on this version of windows.... I'll have to get back to you.

Here is my script anyway

Code: Select all

setlocal enabledelayedexpansion

for %%F in (Front Covers\*.png) do (

  call :StrBackN "%%~nF"

  %IMG7%magick ^
    "Front Covers\%%~nF.png" ^
    ^( -background transparent -size 500x500 ^
       -font Arial-Unicode-MS -fill black -gravity west label:"!NewStr!" ^
       -trim ^
    ^) -gravity Southwest -geometry +80+55 -composite ^
    "Covers\%%~nF.png"
)

exit /B 0

::-------------------
:StrBackN

set strNq=%~1

set strLen=0

set NewStr=

if "%strNq%"=="" exit /B 1 

:loop
set C=!strNq:~%strLen%,1!

if defined C (
  set NewStr=%NewStr%%C%\n
  set /A strLen+=1
  goto loop
)

exit /B 0 

Robin55
Posts: 36
Joined: 2018-03-19T15:29:46-07:00
Authentication code: 1152

Re: How can you add vertical text in batch using the filename.

Post by Robin55 »

Ok I got it back. Don't know what happened there.....
Here are some more screen shots.
https://ibb.co/bX5HBgn
https://ibb.co/JqwBd2p

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How can you add vertical text in batch using the filename.

Post by snibgo »

Robin55 wrote:Here are some more screen shots.
Okay. And ... what? Those show no errors.
snibgo's IM pages: im.snibgo.com

Robin55
Posts: 36
Joined: 2018-03-19T15:29:46-07:00
Authentication code: 1152

Re: How can you add vertical text in batch using the filename.

Post by Robin55 »

Well I'm afraid it's not printing anything on my images. But it's ok now snibgo I have decided that I'll do without the vertical script for this project. Thank you very much for your time and effort It would of been nice to get it vertical but it's just not working and I have dug pretty deep into this project now. So thanks again for your time it is much appreciated.

Locked