Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: PicWoodPecker -- a Tk program to choose and modify your photos

by kcott (Archbishop)
on Nov 30, 2016 at 21:56 UTC ( [id://1176989]=note: print w/replies, xml ) Need Help??


in reply to picwoodpecker -- a Tk program to choose and modify your photos

G'day Discipulus,

I put the code and POD in a file, made a small change to the shebang line, and ran it without any options:

$ picwoodpecker.pl Empty list searching [./*.jpg]! bad event type or keysym "?" at /long/perlbrew/path/Tk/Derived.pm line + 469.

So my first suggestion was to allow the -source path to be selected after the GUI starts if none was specified on the command line (given the POD says this can be changed from the GUI).

Anyway, I tried again a couple of times using different paths with the -s option. Both gave an "ERROR creating a thumbnail ..." message as well as the "bad event type ..." message I noted above. I was able to independently open and view both images: they looked fine. I tried again with the -debug option you've supplied. Here's the entire output:

$ picwoodpecker.pl -s ~/local/doc/misc -debug build_list received [/Users/ken/local/doc/misc] DIR found: [/Users/ken/local/doc/misc] will be converted to [/Users/ke +n/local/doc/misc/*.jpg] Please wait while processing 1 files.... adding /Users/ken/local/doc/misc/Mandel_zoom_00_mandelbrot_set.jpg ERROR creating a thumbnail for file [/Users/ken/local/doc/misc/Mandel_ +zoom_00_mandelbrot_set.jpg].I will use an empty one. bad event type or keysym "?" at /Users/ken/perl5/perlbrew/perls/perl-5 +.24.0t/lib/site_perl/5.24.0/darwin-thread-multi-2level/Tk/Derived.pm +line 469.

I also tried the widget demo. Both applications in the "Photos and Images" section worked without any issues.

I gave up testing at this point; however, I don't mind testing some more if you want to suggest other options, provide a URL to some test image(s), or make code changes.

In general, this does sound like a good idea. One further suggestion would be to allow other formats for the source images: adding Tk::PNG would be more useful for me personally (as an example, I searched my entire '~/local/doc/' tree for '*.jpg' files to test your GUI but only found 2; the same search for '*.png' files found 62).

— Ken

Replies are listed 'Best First'.
Re^2: PicWoodPecker -- a Tk program to choose and modify your photos
by Discipulus (Canon) on Dec 01, 2016 at 09:15 UTC
    Hello kcott,

    first of all thanks for the feedback! Having someone else spending his time looking at my code is something make me happy.

    There are three issues:

    1-the population of pic list

    2-the bad event type or keysym "?" at..

    3-the ERROR creating a thumbnail for file one

    About the second i need to investigate a bit, because i do not understand it. The application has a binding to the ? key to popup a new mainwindow with the rendered POD. It also has some special unbinding for key ? for all Entry widgets.

    This issue possibly resolve itself changing in the code all <KeyRelease-?> declaration into <KeyRelease-question> ones.

    About the first issue you pose it is related to the list population: maybe i've badly explained in the documentation.

    By default the app search the current directory for jpeg files: ie it globs ./*.jpg and build the list. If no image are found it complains about in the console.

    perl c:\SCRIPTS\resized\picwoodpecker-v10.10.pl -s c:/scripts/resized/ +user -debug build_list received [c:/scripts/resized/user] DIR found: [c:/scripts/resized/user] will be converted to [c:/scripts/ +resized/user/*.jpg] No file to process

    If so you can select a new directory to search using the GUI: the button browse to choose the dir and new list one to populate it. Or you could simply write the dir or the glob expression into the source entry.

    In the docs i put the phrase: Note the that the browse does not fill the list; you need to use new list or add to list after using it.

    The app is already able to process png files: you must tell it using the source/glob expression:

    perl c:\SCRIPTS\resized\picwoodpecker-v10.10.pl -s c:/scripts/*.png -d +ebug build_list received [c:/scripts/*.png] Please wait while processing 6 files.... adding c:/scripts/colorRamp.png adding c:/scripts/Mandelbrot_Love_by_sya.png adding c:/scripts/out.png adding c:/scripts/test.png adding c:/scripts/testHEX.png adding c:/scripts/testHEX2.png

    Finally the thumbnail errors: the application search for and embedded thumbnail that usually is present in jpg photos but not in other files formats. If the embedded thumb is not present the program emit the error (maybe is better a warning?) and creates an empty one ie a black one using GD.

    Perhaps the best behaviour is search for an embedded thumb and make it up a new one if not found. I'll put the program on github and I'll try to add suche feature.

    thanks again

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
Re^2: PicWoodPecker -- a Tk program to choose and modify your photos
by Discipulus (Canon) on Dec 01, 2016 at 12:08 UTC
    Hello kcott,

    I put the program on github: can you be so kind to try if the keysim error disappears using this release?

    Thanks for your time.

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

      The short answer is "no". I ran exactly the same commands as shown previously and got exactly the same output.

      My current perl:

      $ perl -v | head -2 | tail -1 This is perl 5, version 24, subversion 0 (v5.24.0) built for darwin-th +read-multi-2level

      I have lots of Perl versions installed. What are you using?

      I already had the latest Tk. I initially needed to install GD and Image::ExifTool. Here's the versions of all of those:

      Tk 804.033 GD 2.56 Image::ExifTool 10.36

      The shebang line change I made was minimal:

      $ head -1 picwoodpecker.pl #!/usr/bin/env perl

      I don't really have the time to look closely at your 1,828 lines of code. I did quickly scroll through it. One thing I did notice was multiple function calls like:

      &func

      While that may be intentional, are you aware of the side effects (described in perlsub). The more usual form is:

      func()

      I didn't investigate whether those side effects had any bearing on the current issues.

      — Ken

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1176989]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2024-04-20 01:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found