Latest post of the previous page:
And what about Width and Height parameters?
Latest post of the previous page:
And what about Width and Height parameters?
Code: Select all
if ok then return 'hello' end --return Vals[1]..'x'..Vals[2] end
Code: Select all
local MediaInfo_GUID = '919C1FC6-A571-4642-99DF-BDACE840ED18'
local function GetPicSize(FilePath)
local ok,n,_,Vals=Plugin.SyncCall(MediaInfo_GUID, FilePath,'{Width,Height}')
return 'ok='..tostring(ok)..'; n='..tostring(n)..'; '..tostring(Vals[1])..', '..tostring(Vals[2])
end
ContentColumns {
filemask = "*.webp,*.bmp,*.gif,*.jpg,*.png,*.psd,*.jpe,*.jpeg,*.cdr,*.wmf,*.ai,*.cmx,*.svg,*.emf,*.ico,*.icl,*.cur,*.ani,*.dds,*.tif,*.tiff,*.tga,*.pcx,*.pic,*.jpc,*.jp2,*.j2k,*.mng,*.psp,*.xbm,*.xpm,*.dib,*.rle,*.lbm,*.iff,*.pbm,*.pgm,*.ppm,*.ras,*.sgi,*.rgb,*.bw,*.wbmp,*.dcx,*.cel,*.flc,*.fli,*.spr,*.fpx";
GetContentFields = function(ColNames)
for j,v in ipairs(ColNames) do
if v:lower()=="size" then return true end
end
end;
GetContentData = function(FilePath,ColNames)
local data = {}
for j,v in ipairs(ColNames) do
if v:lower() == 'size' then
local PicSize = GetPicSize(FilePath)
data[j] = PicSize or ''
end
end
return next(data) and data
end;
}
local ok,n,_,Vals=Plugin.SyncCall(MediaInfo_GUID, FilePath,'{Width,Height}') if ok and n == 2 then return Vals[1]:gsub('[%s%a]','') .. 'x' .. Vals[2]:gsub('[%s%a]','') end
Even easier:
Vals[1]:gsub("%D",''), Vals[2]:gsub("%D",'')
lua:require"le"{Plugin.SyncCall('919C1FC6-A571-4642-99DF-BDACE840ED18', APanel.Current,"{Width,Height}")}
╔═══════════════════════════════ (4) ═══════════════════════════════╗ ║≡ 0x00000003 (3) │table │table: 0x016191a019a8 ║ ║≡ 0x00000004 (4) │table │table: 0x016191b41fb8 ║ ║ 0x00000001 (1) │boolean │true ║ ║ 0x00000002 (2) │number │0x00000002 (2) ║ ╚══════════════════════ F1, F3, F4, Del, Ctrl+M ══════════════════════╝
Enter
on (3):
╔══════════════════════════════ 3 (4) ═══════════════════════════════╗ ║ n │number │0x00000002 (2) ║ ║ 0x00000001 (1) │string │Width ║ ║ 0x00000002 (2) │string │Height ║ ║ type │string │array ║ ╚══════════════════════ F1, F3, F4, Del, Ctrl+M ══════════════════════╝
Esc
, Enter
on (4):
Attention!╔══════════════════════════════ 4 (4) ═══════════════════════════════╗ ║ n │number │0x00000002 (2) ║ ║ 0x00000001 (1) │string │1 125 pixels ║ ║ 0x00000002 (2) │string │2 436 pixels ║ ║ type │string │array ║ ╚══════════════════════ F1, F3, F4, Del, Ctrl+M ══════════════════════╝