* Thumbnails now stored in ".thumbs" subdirectory under "saved".

* Moved "tuxpaint-import.1" source into "src/manpage"
This commit is contained in:
William Kendrick 2003-06-17 09:10:57 +00:00
parent be7efbb0d5
commit face1b6038
6 changed files with 90 additions and 22 deletions

View file

@ -6,7 +6,7 @@
# bill@newbreedsoftware.com
# http://www.newbreedsoftware.com/tuxpaint/
# June 14, 2002 - April 5, 2003
# June 14, 2002 - June 17, 2003
# Where to install things:
@ -500,7 +500,7 @@ install-man:
@gzip -f $(MAN_PREFIX)/pl/man1/tuxpaint.1
@chmod a+rx,g-w,o-w $(MAN_PREFIX)/pl/man1/tuxpaint.1.gz
@# tuxpaint-import.1
@cp src/tuxpaint-import.1 $(MAN_PREFIX)/man1/
@cp src/manpage/tuxpaint-import.1 $(MAN_PREFIX)/man1/
@gzip -f $(MAN_PREFIX)/man1/tuxpaint-import.1
@chmod a+rx,g-w,o-w $(MAN_PREFIX)/man1/tuxpaint-import.1.gz

View file

@ -73,6 +73,16 @@ http://www.newbreedsoftware.com/tuxpaint/
saved were unable to load the newest images! (Hopefully 1024 saved
files is sufficient.)
* Thumbnails now saved to a ".thumbs" subdirectory under "saved".
(Old thumbnails will still be loaded, if found. Currently, the old
thumbnails will still be saved in the old location, not under .thumbs)
Ben Armstrong's suggestion.
* Updated tuxpaint-import to create .thumbs subdirectory, and put new
thumbnails there.
* Moved "tuxpaint-import.1" from src/ to src/manpage/.
2003.February.22 (0.9.10)
* UTF-8 stamp descriptions word-wrap around spaces.

View file

@ -6,7 +6,7 @@ Copyright (c) 2003 by Bill Kendrick
bill@newbreedsoftware.com
http://www.newbreedsoftware.com/tuxpaint/
May 23, 2003
June 17, 2003
LOW-PRIORITY DOCUMENTATION CHANGES:
@ -16,12 +16,6 @@ LOW-PRIORITY DOCUMENTATION CHANGES:
* Mention CONFDIR in INSTALL.txt
HIGH-PRIORITY IMPLEMENTATION CHANGES:
-------------------------------------
* Move thumbnails into a ".thumbnails" subdirectory under ".tuxpaint/saved"
(Ben Armstrong's suggestion)
LOW-PRIORITY IMPLEMENTATION CHANGES:
------------------------------------
* Fix and use scanline fill for filled shapes.
@ -79,8 +73,6 @@ PLATFORM-SPECIFIC BUGS:
HIGH-PRIORITY TRANSLATION STUFF:
--------------------------------
* Right-justify right-to-left strings.
* Make right-to-left strings not wordwrap with the shortest line at
the top!

View file

@ -1,5 +1,5 @@
.\" tuxpaint-import.1 - 2002.10.19
.TH TUXPAINT-IMPORT 1 "19 Oct 2002" "2002.10.19" "Tux Paint Import"
.\" tuxpaint-import.1 - 2003.06.17
.TH TUXPAINT-IMPORT 1 "17 Jun 2003" "2003.06.17" "Tux Paint Import"
.SH NAME
tuxpaint-import -- Import image files into Tux Paint(1)
@ -32,6 +32,10 @@ to determine where the files should go so that they can be access within
where new image files are stored, after being resized and converted into PNG
format.
.TP 8
.B $HOME/.tuxpaint/saved/.thumbs
where thumbnail images are stored.
.SH AUTHOR
Bill Kendrick. <bill@newbreedsoftware.com>

View file

@ -9,7 +9,7 @@
# bill@newbreedsoftware.com
# http://www.newbreedsoftware.com/tuxpaint/
# September 21, 2002 - January 16, 2003
# September 21, 2002 - June 17, 2003
TMPDIR=/tmp
@ -45,6 +45,12 @@ if [ ! -d $SAVEDIR ]; then
mkdir -p $SAVEDIR
fi
# Make sure savedir thumbs directory exists!
if [ ! -d $SAVEDIR/.thumbs ]; then
echo "Creating $SAVEDIR/.thumbs"
mkdir -p $SAVEDIR/.thumbs
fi
# For each picture list...
for i in $*
@ -68,7 +74,7 @@ do
# Create thumbnail for 'Open' dialog:
pngtopnm $SAVEDIR/$NEWFILENAME.png | pnmscale -xysize 92 56 \
| pnmtopng > $SAVEDIR/$NEWFILENAME-t.png
| pnmtopng > $SAVEDIR/.thumbs/$NEWFILENAME-t.png
else
# File wasn't there!

View file

@ -8050,7 +8050,34 @@ int do_save(void)
"%s\n\n", fname, strerror(errno));
fprintf(stderr,
"Cannot save the any pictures! SORRY!\n\n");
"Cannot save any pictures! SORRY!\n\n");
draw_tux_text(TUX_OOPS, SDL_GetError(), 0, 0, 0);
free(fname);
return 0;
}
free(fname);
show_progress_bar();
/* Make sure we have a ~/.tuxpaint/saved/.thumbs/ directory: */
fname = get_fname("saved/.thumbs");
res = mkdir(fname, 0755);
if (res != 0 && errno != EEXIST)
{
fprintf(stderr,
"\nError: Can't create user data thumbnail directory:\n"
"%s\n"
"The error that occurred was:\n"
"%s\n\n", fname, strerror(errno));
fprintf(stderr,
"Cannot save any pictures! SORRY!\n\n");
draw_tux_text(TUX_OOPS, SDL_GetError(), 0, 0, 0);
@ -8116,11 +8143,27 @@ int do_save(void)
show_progress_bar();
/* Save thumbnail, too: */
/* (Was thumbnail in old directory, rather than under .thumbs?) */
snprintf(tmp, sizeof(tmp), "saved/%s-t%s", file_id, FNAME_EXTENSION);
fname = get_fname(tmp);
fi = fopen(fname, "r");
if (fi != NULL)
{
fclose(fi);
}
else
{
/* No old thumbnail! Save this image's thumbnail in the new place,
under ".thumbs" */
snprintf(tmp, sizeof(tmp), "saved/.thumbs/%s-t%s", file_id, FNAME_EXTENSION);
fname = get_fname(tmp);
}
debug(fname);
thm = thumbnail(canvas, THUMB_W - 20, THUMB_H - 20, 0);
@ -8524,10 +8567,22 @@ int do_open(int want_new_tool)
/* Try to load thumbnail first: */
snprintf(fname, sizeof(fname), "%s/%s-t.png", dirname,
d_names[num_files]);
snprintf(fname, sizeof(fname), "%s/.thumbs/%s-t.png",
dirname, d_names[num_files]);
debug(fname);
img = IMG_Load(fname);
if (img == NULL)
{
/* No thumbnail in the new location ("saved/.thumbs"),
try the old locatin ("saved/"): */
snprintf(fname, sizeof(fname), "%s/%s-t.png", dirname,
d_names[num_files]);
debug(fname);
img = IMG_Load(fname);
}
if (img != NULL)
{
@ -8546,7 +8601,8 @@ int do_open(int want_new_tool)
num_files++;
}
else
if (img == NULL)
{
/* No thumbnail - load original: */
@ -8605,8 +8661,8 @@ int do_open(int want_new_tool)
debug("Saving thumbnail for this one!");
snprintf(fname, sizeof(fname), "%s/%s-t.png", dirname,
d_names[num_files]);
snprintf(fname, sizeof(fname), "%s/.thumbs/%s-t.png",
dirname, d_names[num_files]);
fi = fopen(fname, "wb");
if (fi == NULL)