cwensley / pablodraw

PabloDraw is an Ansi/Ascii text and RIPscrip vector graphic art editor/viewer with multi-user capabilities.
MIT License
315 stars 21 forks source link

3.3.0-beta1 CWD/path issues when fed file from CLI #57

Closed Sembiance closed 1 year ago

Sembiance commented 2 years ago

When using 3.3.0-beta1.tar.gz under Linux 5.18.8 it appears as if path handling might be a bit messed up in regards to the current working directory and passing files in from the command line.

I have in /tmp the PabloDraw binary and the test.rip file (attached in test.zip)

What Works

If I launch PabloDraw and then navigate in the UI to /tmp/test.rip everything works fine and the file renders.

What Mostly Works

If I launch with an absolute path to an input file: ./PablowDraw /tmp/test.rip the file renders OK, but it pops up an error:

System.NotSupportedException: NotSupported_UnseekableStream
   at System.IO.BufferedStream.EnsureCanSeek()
   at System.IO.BufferedStream.get_Position()
   at Pablo.Formats.Animated.BaudStream.get_Position() in /home/runner/work/pablodraw/pablodraw/Source/Pablo/Formats/Animated/BaudStream.cs:line 59
   at Pablo.Sauce.SauceStream.get_Position() in /home/runner/work/pablodraw/pablodraw/Source/Pablo/Sauce/SauceStream.cs:line 45
   at Pablo.StreamExtensions.IsEOF(Stream stream) in /home/runner/work/pablodraw/pablodraw/Source/Pablo/StreamExtensions.cs:line 11
   at Pablo.Formats.Rip.FormatRip.Load(Stream stream, RipDocument document, RipHandler handler) in /home/runner/work/pablodraw/pablodraw/Source/Pablo/Formats/Rip/FormatRip.cs:line 59
   at Pablo.Formats.Rip.RipDocument.LoadStream(Stream stream, Format format, Handler handler) in /home/runner/work/pablodraw/pablodraw/Source/Pablo/Formats/Rip/RipDocument.cs:line 165
   at Pablo.Document.Load(Stream stream, Format format, Handler handler) in /home/runner/work/pablodraw/pablodraw/Source/Pablo/Document.cs:line 121
   at Pablo.Formats.Animated.AnimatedDocument.LoadBase(Stream stream, Format format, Handler handler) in /home/runner/work/pablodraw/pablodraw/Source/Pablo/Formats/Animated/AnimatedDocument.cs:line 241
   at Pablo.Formats.Animated.AnimatedDocument.DocumentThreadLoader.Load() in /home/runner/work/pablodraw/pablodraw/Source/Pablo/Formats/Animated/AnimatedDocument.cs:line 144
   at System.Threading.Thread.StartCallback()

What Doesn't Work

If I launch with a relative path to an input file ./PabloDraw ./test.rip or just the name of a file the current working directory ./PabloDraw test.rip then the file DOES NOT render and the same 'UnseekableStream' error as above pops up.

Sembiance commented 2 years ago

Just tested this with latest source code as of a few moments ago, same problems.