WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: FL-PicSee 1.2.x / 1.3.x PRE-RELEASE  (Read 12900 times)

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
FL-PicSee 1.2.x / 1.3.x PRE-RELEASE
« on: August 26, 2010, 10:48:28 PM »
EDIT: See later posts below for the latest version, 1.2.6.  Also new version of icon posted here.

Hello again.  I've not posted much recently in this programming section, but a lot has been going on behind the scenes.   8)  First up: a new beta release of the FL-PicSee picture viewer.

New features:

* Slideshow - 6 second automatic paging through multiple files
* Titlebar now shows "X of Y" when paging multiple images
* Smaller (prettier?) paging hotspots in upper left and right corners
* Improved keyboard handling
* Build-tcz.sh script - automates making the .tcz file and associated .list and .md5 files
* Icon for wbar or other window managers
* (VERSION 1.2.4+) Automatic file-type identification (filename does not need .jpg, .png, etc.)

The new keyboard handling does not automatically pop open the right-click menu when you press the Ctrl key (as in the prior version), which makes typing the normal window management key combinations in FLWM possible.  However, you can now quickly pop open the menu with the "Windows" key or the context menu key on most keyboards.  All of the normal FL-PicSee Ctrl+Key combinations now work without the right-click menu being visible.

Over time, I grew to dislike the appearance of the large paging "hotspots" on the left and right side of image window.  The hotspots are now rounded rectangles with the word "Next" or "Prev" that appear when you mouse-over the upper left and right corners of the image window.  Hopefully, these are large enough to still be easy for most people to use.  There are several keyboard equivalents for paging, including Space and Backspace, Page Down/Up, Ctrl+ArrowDown/Up.

Before I request the Core team to package this for a new official release, I would invite anyone interested to download, build, and test this beta version.  If you find bugs, please post them here.  Or if you have ideas for the future, please let me know.

Some potential future features (no promises!):
* Slideshow control: at least adjust timing of transitions
* Thumbnail view
* Animated GIF (not in FLTK... need a custom viewer class?)
--
Mike Lockmoore
« Last Edit: October 01, 2010, 02:56:22 PM by MikeLockmoore »

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: FL-PicSee 1.2.x
« Reply #1 on: August 27, 2010, 02:34:47 AM »
Would it be easy to also post a binary (compiled) version for testing?

An improvement I would wish for would be that flpicsee would become agnostic to filename extensions; e.g. that it would open pics which have no filename extensions at all (e.g. in browser cache directory).
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: FL-PicSee 1.2.x
« Reply #2 on: August 27, 2010, 03:20:31 AM »
Since you have a script to build the tcz, and the already-posted extension as guidance, I believe you can submit it when you feel it's ready. :)
The only barriers that can stop you are the ones you create yourself.

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
Re: FL-PicSee 1.2.x
« Reply #3 on: August 27, 2010, 04:54:46 AM »
Thanx a lot for this new version.
The "windows" key doesn't work on my system.
dCore user

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Re: FL-PicSee 1.2.x
« Reply #4 on: August 27, 2010, 09:44:14 AM »
@tinypoodle: Unfortunately, one is not allowed to post binary files to this forum.  If you want to build it yourself, you will need to install at least the compiletc.tgz and squashfs-tools-4.0.tcz extensions.  I will probably submit the new version plus any last-minute fixes as updates within a week or two, so you can get it from the official repository soon.  

As for working without file extensions, perhaps FL-PicSee could just try to create the various image types like Fl_JPEG_Image until one is successful, but that might be slow and not always work (the FL_xxx_Image object instantiates OK, but displays garbage when the image type is really something else).  To work well without file extensions, FL-PicSee will need some new code to "sniff" the image type from the file data.  Chances are, each image file structure probably has some distinctive marker data by which one can determine the image type, but I have not looked into the details for this.  Interesting idea, but I don't know how complex it would be yet.

@jls_legalize: The posted version includes a print statement that will display the key code for any key combined with Ctrl that FL-PicSee does not recognize.  You can try that with your Windows key and let me know the key code.  

However, it may be better to always print the key codes, in which case you need to make a minor modification.

Find this bit of code starting about line 616:
Code: [Select]
       case FL_KEYDOWN:
            key = Fl::event_key();
            if (key == FL_Control_L || key == FL_Control_R) {
                ctrl_pressed = 1;
            }

Insert the following printf() statement:
Code: [Select]
       case FL_KEYDOWN:
            key = Fl::event_key();
            printf("You pressed key %d (0x%4X)\n", key, key);
            if (key == FL_Control_L || key == FL_Control_R) {
                ctrl_pressed = 1;
            }

Build this version, start it from the command line, press your "Windows" key, and tell me the key code you see?  If you don't get any key code for your key, I won't be able to help.  Do you have a context menu key?  If so, does it work?  That is the more proper key for this menu, but on at least on my eeePC, the Windows key also works (returns key code 0, which triggers the context menu, as seen around line 621).
--
Mike
« Last Edit: August 27, 2010, 09:46:07 AM by MikeLockmoore »

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: FL-PicSee 1.2.x
« Reply #5 on: August 27, 2010, 10:13:34 AM »
@tinypoodle: Unfortunately, one is not allowed to post binary files to this forum.
Sorry, was unaware of that, my bad.  :(
Quote
To work well without file extensions, FL-PicSee will need some new code to "sniff" the image type from the file data.  Chances are, each image file structure probably has some distinctive marker data by which one can determine the image type, but I have not looked into the details for this.  Interesting idea, but I don't know how complex it would be yet.
Observation: rox-filer is displaying thumbnails for all common pic formats, regardless of missing extensions. Clicking on such when having associated flpicsee as default viewer for pic formats results in an error popup window from flpicsee. rox-filer has "file.tcz" as a dep, I could blindguess that might be involved in the mechanism of determination.

Random example:
Code: [Select]
tc@box:~$ file .opera/cache/opr00VOJ  
.opera/cache/opr00VOJ: JPEG image data, JFIF standard 1.01
but then file.tcz is of multiple size compared to flpicsee, so I guess of no practical use at all

EDIT:
Code: [Select]
tc@box:~$ strings .opera/cache/opr00VOJ |head -n 1
JFIF
« Last Edit: August 27, 2010, 10:27:57 AM by tinypoodle »
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Pats

  • Sr. Member
  • ****
  • Posts: 322
Re: FL-PicSee 1.2.x
« Reply #6 on: August 27, 2010, 12:03:16 PM »
My Wishlist:
1) Image file Drop-down feature ( one should be able to drop image-files on Picsee)
2) Basic image-file conversion facility ( Eq: BMP to JPEG etc)
3) Repeated File chooser facility
4) One should be able to set Opend Image File as Backgorund Image.
5) Image Crop-up feature.
:)
~Pats

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Re: FL-PicSee 1.2.x
« Reply #7 on: August 27, 2010, 02:38:35 PM »
@tinypoodle: I looked at the file formats for ways to distinguish the types from their initial content and (thankfully) it seems straightforward for all of the types of images FLTK supports.  So I implemented it (only took a few minutes  ;) ).

FL-PicSee version 1.2.4 examines the first 16 bytes of the image file content for a distinguishing tags and sets the image type accordingly.  For the most common image types, I think this will be more robust that depending on the file extension, and I think the code size is about the same.  It is possible that .xpm and .xbm formats are a little too loosely-specified for my current code.  If anyone finds an image file that FL-PicSee does not correctly  identify and open, please let me know.  Maybe post it here if it is not too big.
--
ML
« Last Edit: August 27, 2010, 03:16:35 PM by MikeLockmoore »

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: FL-PicSee 1.2.x
« Reply #8 on: August 27, 2010, 02:47:33 PM »
MikeLockmoore:

That was quick...  ;D
Sounds great, thanks
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Re: FL-PicSee 1.2.x
« Reply #9 on: August 27, 2010, 03:26:14 PM »
@tinypoodle: Maybe too quick.  :-[  I needed to correct something, and I took the opportunity to reorganize the image-type recognition code into a separate function that can be called from two different places.  Version 1.2.4 is the latest now.

@Pats:  I would also like drag-and-drop some day.  You can already select multiple files in the file open dialog box (ctrl+click each), or if you mean add additional files to the set you are viewing, you can do that with the "Open Another" menu item.  Or did you mean something else in point 3?  As for the conversion and cropping... I'm not sure I want FL-PicSee to turn into an editing tool.  If that happens, it will be further into the future.  RobertS asked for your suggestion 4 when I first made FL-PicSee.  There were changes being made in bakground image management in the base system, so I didn't try to implement it.  I hesitate to make a feature too Tinycore-specific, but I might as a compile-time option.
--
ML

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
Re: FL-PicSee 1.2.x
« Reply #10 on: August 27, 2010, 05:57:20 PM »
After the modification u suggested when I press the win key I see:
You pressed key 65516 (0xFFEC)

and when I press the menu key :
You pressed key 65383 (0xFF67)
dCore user

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Re: FL-PicSee 1.2.x
« Reply #11 on: August 27, 2010, 06:53:40 PM »
@jls_legalize: I special-cased your keys.  I'll post a new source version later today or tomorrow.  But if you want to test it yourself, just replace:

Code: [Select]
           if (key == 0) {                
                do_menu();
                return 1;
            }

with:
 
Code: [Select]
           if (key == 0 || key == 0xFFEC || key == 0xFF67) {                
                do_menu();
                return 1;
            }

Well, only the first line changed.  This is just a bit after the area you modified.  About line 703 in the 1.2.4 version.

EDIT: version 1.2.5 is attached here.  It has the above key handling code, plus the printf() for each keystroke that jls added manually.  If anyone else sees other key codes for their special context-menu key, please let me know.  This version also handles an invalid filename or non-image file in a more user-friendly way.
--
Mike
« Last Edit: August 28, 2010, 10:42:07 AM by MikeLockmoore »

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Re: FL-PicSee 1.2.x
« Reply #12 on: August 28, 2010, 09:38:52 PM »
Posted a new version of the icon, attached to the original post in this thread above. Enjoy.
--
ML

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Re: FL-PicSee 1.2.x
« Reply #13 on: September 03, 2010, 11:31:36 AM »
Version 1.2.6. One more minor improvement: if you manually page forward or backward while the slideshow is running, the paging timer is reset to allow a full 6 seconds on the new page.  Before, if there was only 1 second remaining before the time for the next picture, and you page manually, the picture you paged to manually would be replaced in 1 second.
--
Mike

Offline ixbrian

  • Retired Admins
  • Sr. Member
  • *****
  • Posts: 436
Re: FL-PicSee 1.2.x
« Reply #14 on: September 05, 2010, 10:52:52 PM »
I tried out FL-PicSee the other day and was impressed at the functionality and ease of use for such a tiny application.  Keep up the good work!

Thanks,
Brian