filenames with wihte spaces are not supported by tuxpaint-import script

Bug #334576 reported by vitjok
4
Affects Status Importance Assigned to Milestone
Tux Paint
Unknown
Unknown
tuxpaint (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: tuxpaint

1) Filename without white spaces (works):

$ tuxpaint-import Desktop/file.png
grep: /usr/local/etc/tuxpaint/tuxpaint.conf: No such file or directory
grep: /home/vitjok/.tuxpaintrc: No such file or directory
Using save directory: /home/vitjok/.tuxpaint/saved
grep: /usr/local/etc/tuxpaint/tuxpaint.conf: No such file or directory
grep: /home/vitjok/.tuxpaintrc: No such file or directory
Using 608 x 496 images (for 800 x 600 Tux Paint
Desktop/file.png -> /home/vitjok/.tuxpaint/saved/20090225224308.png

2) Filename with white spaces (does not work):

$ tuxpaint-import Desktop/tux\ folder/other\ file.png
[: 50: folder/other: unexpected operator
grep: /usr/local/etc/tuxpaint/tuxpaint.conf: No such file or directory
grep: /home/vitjok/.tuxpaintrc: No such file or directory
Using save directory: /home/vitjok/.tuxpaint/saved
grep: /usr/local/etc/tuxpaint/tuxpaint.conf: No such file or directory
grep: /home/vitjok/.tuxpaintrc: No such file or directory
Using 608 x 496 images (for 800 x 600 Tux Paint
[: 173: folder/other: unexpected operator
Desktop/tux folder/other file.png - File not found

--------------------------------------

$ lsb_release -rd
Description: Ubuntu 8.10
Release: 8.10

$ apt-cache policy tuxpaint
tuxpaint:
  Installiert: 1:0.9.20-2ubuntu1
  Kandidat: 1:0.9.20-2ubuntu1
  Versions-Tabelle:
 *** 1:0.9.20-2ubuntu1 0
        500 http://de.archive.ubuntu.com intrepid/main Packages
        100 /var/lib/dpkg/status

Revision history for this message
Caroline Ford (secretlondon) wrote :

I'm not exactly sure what you are saying here. What has grep got to do with it? Why are you trying to import tuxpaint.conf?

Could you give me a simple example? I don't have access to an Ubuntu machine at the moment to try and see what you are doing.

What happens when you try and import my picture.png (and it exists)?

Can you give me the full error message?

Changed in tuxpaint:
status: New → Incomplete
Revision history for this message
vitjok (vitjok-gmx) wrote :

The tuxpaint-import script executes the grep commands, I think it trys to find config files.

My english is very poor, so i posted the executed commands and the followed outputs.

command: $ tuxpaint-import Desktop/file.png # (file.png exists)

output: grep: /usr/local/etc/tuxpaint/tuxpaint.conf: No such file or directory
                grep: /home/vitjok/.tuxpaintrc: No such file or directory
                Using save directory: /home/vitjok/.tuxpaint/saved
                grep: /usr/local/etc/tuxpaint/tuxpaint.conf: No such file or directory
                grep: /home/vitjok/.tuxpaintrc: No such file or directory
                Using 608 x 496 images (for 800 x 600 Tux Paint
                Desktop/file.png -> /home/vitjok/.tuxpaint/saved/20090225224308.png

What is happened? >> the script tuxpaint-import created the file 20090225224308.png in the folder /home/vitjok/.tuxpaint/saved.
This is exactly that what the job of tuxpaint-imort is.

on execute this command: $ tuxpaint-import Desktop/tux\ folder/other\ file.png

occours an error, error output: [: 50: folder/other: unexpected operator
                                                 grep: /usr/local/etc/tuxpaint/tuxpaint.conf: No such file or directory
                                                 grep: /home/vitjok/.tuxpaintrc: No such file or directory
                                                 Using save directory: /home/vitjok/.tuxpaint/saved
                                                 grep: /usr/local/etc/tuxpaint/tuxpaint.conf: No such file or directory
                                                 grep: /home/vitjok/.tuxpaintrc: No such file or directory
                                                 Using 608 x 496 images (for 800 x 600 Tux Paint
                                                 [: 173: folder/other: unexpected operator
                                                 Desktop/tux folder/other file.png - File not found

What is happened? >> nothing, file was not created/imported.

I hope this describes the bug better.

Revision history for this message
vitjok (vitjok-gmx) wrote :

I solved the Problem for me.

#------I do not know whether this is important -----------------
#Just by the way: there is a difference between tuxpaint-import on my ubuntu 8.10 ang the sourceforge cvs repository:
#line 146 on my ubuntu box:
# i=$(eval echo \$\{$x\})
#
#line 146 on sourceforge cvs:
# i="${!x}"
#
#If I use the line from sourceforge cvs, i get an error: "Bad substitution", so I still use the line from my ubuntu version.
#-------------------------------------------------------------------------

So, now to my problem with white spaces.
I replaced the line 148:
    if [ -e $i ]; then
by this line:
    if [ -e "$i" ]; then

and the line 154:
    anytopnm $i | pnmscale -xysize $width $height > $TMPDIR/saved/$NEWFILENAME.ppm
by this line:
    anytopnm "$i" | pnmscale -xysize $width $height > $TMPDIR/saved/$NEWFILENAME.ppm

just replace $i by "$i".

And now it works for me, i can now place a starter on the desktop and by drag and drop import *all* Images in tuxpaint.

I am not sure, whether this change is OK for all and whether other user has this bug too.
So, it would be great if somebody (with more experience in shell programming) check this.

PS: /bin/sh points to /bin/dash

Oh no, that is great :-(, after I solved the problem for me, I founded this bug report:
http://sourceforge.net/tracker/index.php?func=detail&aid=1527884&group_id=66938&atid=516295
This resolve was founded over 2 years ago, but the problem was never fixed, or am i mistaken?

Revision history for this message
Caroline Ford (secretlondon) wrote :

I've reported this upstream.

Changed in tuxpaint (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Caroline Ford (secretlondon) wrote :

This has apparently been fixed in CVS, which will become tuxpaint 0.9.21.

Revision history for this message
vitjok (vitjok-gmx) wrote :

yes it was committed ---- revision 1.9, Sat Jun 13 21:27:41 2009 UTC -----
thank you for reporting upstream.

What do you think, when it will be available in Ubuntu? (empirical value)

Revision history for this message
Caroline Ford (secretlondon) wrote : Re: [Bug 334576] Re: filenames with wihte spaces are not supported by tuxpaint-import script

Karmic I hope. It'll be in 0.9.21 which has just (quietly) released as
windows binaries not yet available.

Hopefully Ben at Debian will package soon then I'll ask for a manual
sync/merge of 0.9.21.

Sent from a mobile device.

On 2 Jul 2009, at 23:30, vitjok <email address hidden> wrote:

> yes it was committed ---- revision 1.9, Sat Jun 13 21:27:41 2009
> UTC -----
> thank you for reporting upstream.
>
> What do you think, when it will be available in Ubuntu? (empirical
> value)
>
> --
> filenames with wihte spaces are not supported by tuxpaint-import
> script
> https://bugs.launchpad.net/bugs/334576
> You received this bug notification because you are a direct subscriber
> of the bug.

Revision history for this message
Caroline Ford (secretlondon) wrote :

0.9.21 has been uploaded to debian. I'll ask for a sync/merge so hopefully it will appear in Ubuntu 9.10 in October.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.