birdal46 / grafx2

Automatically exported from code.google.com/p/grafx2
0 stars 0 forks source link

new lua function : getfilename #438

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

i was trying to write an export function for lua but I need some functions like:

- get_path = returns path where the currently edited picture is stored
- get_filename = returns the filename of the picture (picture.gif)
- get_basename = returns the filename of the picture without the extension 
(picture)
- get_number_of_used_palette_colors

... greetings HoraK-FDF

Original issue reported on code.google.com by HoraK-...@web.de on 2 May 2011 at 5:09

GoogleCodeExporter commented 8 years ago
I'm pretty sure the last one is available in DawnBringer's toolbox as a lua 
implementation.

I'll make a single one that gets the full path to the picture, then you'll have 
to use lua to split the string and extract the parts you want.

Original comment by pulkoma...@gmail.com on 24 Sep 2011 at 1:18

GoogleCodeExporter commented 8 years ago
Fixed in r1826.

Original comment by pulkoma...@gmail.com on 24 Sep 2011 at 1:39

GoogleCodeExporter commented 8 years ago
from http://code.google.com/p/grafx2/wiki/BrushFactory i find getfilename(), 
but how can i use it on a snippet? - when i use "(name, path) = getfilename()" 
i get "')' expected near ','", and when i use "name, path = getfilename()" i 
get "attempt to call global 'getfilename' (a nil value)" - i'm curious about 
using it like for saving text or binary files of information extracted from the 
picture

Original comment by nitrofur...@gmail.com on 31 Jul 2012 at 7:49

GoogleCodeExporter commented 8 years ago
The right syntax is the second, without parentheses. The function is only 
available in the 2.4WIP version

Original comment by yrizoud on 1 Aug 2012 at 2:28