Hello,
I want to get height and width from metadata of an image file with action 'Get file Metdata' to compare it and eventually rotate the image.
The data is always extracted with a preceding '?'.
I have tried unsuccessfully to delete the sign. I tried 'STR Trim' and 'STR Replace' but it is still available in the data.
I can't find the cause (I am using version 9.1.2.247). Could you please take a look at it?
*UPDATE*
The problem only seems to occur when the action is performed in the RoboTask service. The problem does not exist if the task is started locally.
'?' in metadata of image file
Re: '?' in metadata of image file
The problem is that the SYSTEM session has default language - English. Very often that English is the only locale in SYSTEM session
I writes small example (see below) and get the same result in service mode: But you can extract numbers only by using regular expressions (see "Extracted data" line)
The task is:
I writes small example (see below) and get the same result in service mode: But you can extract numbers only by using regular expressions (see "Extracted data" line)
The task is:
Code: Select all
;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|0
CatID=INTEGER|1649444293
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DisableOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task1476"
Hide=INTEGER|0
ID=INTEGER|-548121441
LogOnAsUser=INTEGER|1
Name=STRING|"Get File Metadata from image"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0
[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
[Actions\Action1]
ActionID=STRING|"A_GETMETADATA"
Enabled=INTEGER|-1
Name=STRING|"Get File Metadata from file C:\temp\DSC_2386.JPG"
Params=FOLDER
[Actions\Action1\Params]
filename=STRING|"C:\temp\DSC_2386.JPG"
prop00000000=STRING|"Width"
prop00000001=STRING|"height"
propcount=STRING|"2"
var00000000=STRING|"w"
var00000001=STRING|"h"
[Actions\Action2]
ActionID=STRING|"A_ROBOTASK_LOG"
Enabled=INTEGER|-1
Name=STRING|"Log Message"
Params=FOLDER
[Actions\Action2\Params]
message=STRING|"raw data: {w} | {h}"
type=STRING|"3"
[Actions\Action3]
ActionID=STRING|"A_REGEXP_MATCH"
Enabled=INTEGER|-1
Name=STRING|"RegExp Match"
Params=FOLDER
[Actions\Action3\Params]
anchored=STRING|"0"
case=STRING|"0"
extended=STRING|"0"
line00000000=STRING|"{w}"
linecount=STRING|"1"
multiline=STRING|"0"
noautocapture=STRING|"0"
pattern=STRING|"[^\d]*(\d+)[^\d]*"
savesubexpression=STRING|"1"
singleline=STRING|"0"
subexpressionpos=STRING|"0"
subexpressionvar=STRING|"expr"
ungreedy=STRING|"0"
useexternal=STRING|"0"
variable=STRING|"found"
[Actions\Action4]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""w"" with value ""{Expr(1)}"""
Params=FOLDER
[Actions\Action4\Params]
expand=STRING|"1"
varname=STRING|"w"
varvalue=STRING|"{Expr(1)}"
[Actions\Action5]
ActionID=STRING|"A_REGEXP_MATCH"
Enabled=INTEGER|-1
Name=STRING|"RegExp Match"
Params=FOLDER
[Actions\Action5\Params]
anchored=STRING|"0"
case=STRING|"0"
extended=STRING|"0"
line00000000=STRING|"{h}"
linecount=STRING|"1"
multiline=STRING|"0"
noautocapture=STRING|"0"
pattern=STRING|"[^\d]*(\d+)[^\d]*"
savesubexpression=STRING|"1"
singleline=STRING|"0"
subexpressionpos=STRING|"0"
subexpressionvar=STRING|"expr"
ungreedy=STRING|"0"
useexternal=STRING|"0"
variable=STRING|"found"
[Actions\Action6]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""h"" with value ""{Expr(1)}"""
Params=FOLDER
[Actions\Action6\Params]
expand=STRING|"1"
varname=STRING|"h"
varvalue=STRING|"{Expr(1)}"
[Actions\Action7]
ActionID=STRING|"A_ROBOTASK_LOG"
Enabled=INTEGER|-1
Name=STRING|"Log Message"
Params=FOLDER
[Actions\Action7\Params]
message=STRING|"extracted data: {w} | {h}"
type=STRING|"3"
Oleg Yershov
Re: '?' in metadata of image file
The process works fine with the 'RegExp Match'-action.
Thanks for your quick support!
Thanks for your quick support!