Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 19 Oct 2018, 09:03
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Building a universal file viewer
Post new topic   Reply to topic View previous topic :: View next topic
Page 16 of 17 [255 Posts]   Goto page: Previous 1, 2, 3, ..., 14, 15, 16, 17 Next
Author Message
anewuser

Joined: 05 Feb 2012
Posts: 79

PostPosted: Sat 08 Sep 2018, 22:29    Post subject:  

MochiMoppel wrote:
I then switched preferences to "Fit images to viewer size" - and the pictures were rendered in less than a second. I never anticipated such a huge difference. I always thought that scaled images would result in slower, not faster rendering. After all GTK has to calculate the new dimension and also MMview has to go through a couple of routines to determine size of viewer pane and scaling factor. Anyway, despite all these additional procedures scaled down pictures display faster.


Offtopic.

My reasoning on scaling images down is a far less quantity of pixels to process and send to the display, that might be a reason why it is faster compared to 10x, 20x, 30x, or 40x the quantity of pixels to display.
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1663
Location: Japan

PostPosted: Mon 10 Sep 2018, 05:55    Post subject:  

anewuser wrote:
My reasoning on scaling images down is a far less quantity of pixels to process and send to the display
Your guess is a good as mine, but all pixels of the original image have to be processed and blocks of original pixels have to be converted into 1 pixel for the scaled image, that's a lot of processing. The number of pixels eventually to be displayed (in the viewer pane) is the same.

I didn't notice a difference for PNG files and for uncompressed formats as BMP it's also no issue as they always are rendered very fast despite their huge file size. So it could well be related to the JPEG compression algorithm.
Anyway, it's interesting but, as you already noted, a bit off topic. Shouldn't be our concern. Important lesson is that scaling doesn't slow the display.

BTW: Next update will include support for Photoshop, RAW and some other image formats. Also included will be support for Exif and other metadata.
Back to top
View user's profile Send private message 
davids45


Joined: 26 Nov 2006
Posts: 1157
Location: Chatswood, NSW

PostPosted: Mon 10 Sep 2018, 21:08    Post subject: Viewer runs in 64bit with 32-bit lib support  

G'day MochiMoppel,

Thanks for this interesting and useful addition to Puppy's small utilities. It worked nicely as a pinboard script.

I turned your (August?) script into a pet then an sfs then an sfs based on links to the sfs files on my data partition. This is the form of added app I now prefer for all my Pups (I combine all these sfs into one so setting up a new Pup with my applications is as easy as possible).

I found your MMView will run in a 64-bit Pup - with its 32-bit compatibility libs also loaded (screenshot). I don't know if MMView would run without the 32bit libs included but these libs are already in my all-applications sfs for my 64bit Pup Frugals.

I've attached my (non-links) sfs for anyone to try - who's brave enough Very Happy .

Looking forward to your next update of mm_view.

David S.
mmviewer.sfs.gz
Description  rename to mmviewer.sfs and test in a frugal, AFTER you've backed-up its savefile! Then look in the FileManager Menu.
gz

 Download 
Filename  mmviewer.sfs.gz 
Filesize  20 KB 
Downloaded  18 Time(s) 
mm_viewer-64slacko-sfslinksversion.jpg
 Description   mmview running from pinboard icon in a 64bit Slacko; icon is linked to sfs stored on data partition
 Filesize   117.79 KB
 Viewed   391 Time(s)

mm_viewer-64slacko-sfslinksversion.jpg

Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1663
Location: Japan

PostPosted: Thu 20 Sep 2018, 00:41    Post subject:  

Update 2018-09-20 (see also initial post)

This update adds more functionality to view and manage digicam photos:
Support for metadata (Exif,IPTC,XMP, Exif comments, GPS geolocation data)
Many more file formats, including camera maker specific RAW formats. I believe that with this update all real life image formats are now supported by MMview.
New or improved buttons make operations easier (I hope).

Metadata
When an image file contains metadata like Exif, it is mentioned in the text above the image. A typical text might read
    36% of 1360x1020 Metadata:Exif,Comment,GPS

This would be a 1360x1020px image, scaled to 36%, containing metadata.
In this case pushing F1 or the new info button will display an "EXIF SUMMARY", a short list of most important Exif values in human readable form, and a usually long list of "EXIF METADATA" , a list of Exif keys and maker notes. Also included may be "IPTC METADATA" , usually used by photo managing applications for adding tags and key words, and "XMP METADATA", a format preferred by some applications, e.g. Adobe Photoshop.

"Comments" would indicate that the file contains an Exif comment. Comments are typically added by the user. MMview allows to add comments via the Commandbox (editing metadata is interesting stuff but I don't want to go into details here. Would be a topic of its own).

"GPS" geolocation data are present when the user has enabled this function in his/her GPS capable smartphone or camera. These data can then be translated into URLs for sites like Google Maps and help to pinpoint the exact location where a photo was taken.

New file formats
.psd (Adobe Photoshop)
MMview displays the preview image embedded in Photoshop files

.ppm, .pgm, .pbm (Portable Pixmap, Portable Greymap, Portable Bitmap).
All part of the Netpbm toolkit. Gtkdialog can't read such files natively so MMview shows a JPEG copy. Note: PPM did not work when tested with Dpup Stretch 7.5. PGM and PBM were fine. Seems that newer versions of ffmpeg have problems with PPM.

.webp (Google's WebP format)
One of the most amazing formats. Much better compression and retained quality than JPEG. See my comparison here. Because of the small file sizes it produces it is ideal for document archiving and is also increasingly used in Japanese ComicBook archives. The catch: ffmpeg can convert them into JPEGs but in my tests avconv could not, so MMview's support is restricted to Puppies with installed ffmpeg.

.dng, .cr2, .mef, .nef, .pef, .erf, .orf, .arw, .mrw, .srw, .rw2, .raf, .3fr
These are all camera specific RAW formats and probably cover most of the popular camera models and makers. All RAW files have preview files embedded, mostly in JPEG format. MMview extracts and displays these previews. Since (undisplayable) main picture and (displayed) preview image usually have different dimensions, no dimension is given in the header text to avoid confusion.

Buttons
An "Additional Info" button is added as an alternative for F1. This also makes it easy to switch between "Instant View" and "Additional Info View".

A new "Toggle Instant View" button deactivates Instant View. This can be useful to speed up scrolling, particularly when "heavy" images or directories make scrolling sluggish. Also useful when only "Additional Info" or "Properties" is of interest and the file content is not needed to display.
This function is also accessible via Menu - View - Disable Instant View Mode.

The "Line Wrapping" button now displays the current status. With most GTK themes is is difficult to see if a button is pushed ("sunken") or not, in this case if line wrapping is on or off. The button icon now changes depending on status, making this destinction much clearer.

Other changes
"Fit images to viewer size" is now the default mode. The previous default, which showed all images in their original size, has been abolished (see here)
mmview_metadata.jpg
 Description   
 Filesize   144.26 KB
 Viewed   350 Time(s)

mmview_metadata.jpg

Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5232
Location: Republic of Novo Zelande

PostPosted: Sun 14 Oct 2018, 04:23    Post subject:  

Is there any possibility of adding a function which could display thumbnails of images in a directory? Even if it was a pretty slow process it could be handy when you are trying to hunt down a specific image within a multitude of images on a camera card or similar.
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1663
Location: Japan

PostPosted: Mon 15 Oct 2018, 01:22    Post subject:  

Nothing is impossible but ROX-Filer already can do what you ask for. Not good enough?
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 12820
Location: Gatineau (Qc), Canada

PostPosted: Mon 15 Oct 2018, 03:23    Post subject:  

greengeek wrote:
Is there any possibility of adding a function which could display thumbnails
of images in a directory? Even if it was a pretty slow process it could be
handy when you are trying to hunt down a specific image within a multitude
of images on a camera card or similar.

Hi greengeek.

Adding to MochiMppei's remark:

IMO, this can be achieved more efficiently through a specialized app, rather
than through a universal viewer such as MochiMoppei's.

qeekie, GQView, XNViewMP and no doubt a couple of other image viewers
(have you searched the Internet on this?) can also show thumbnails of
images in a directory. Plus they all offer various sizes for thumbnails.
ROX is limited in that respect.

I remember that XnViewMP offers the capacity to create "contact sheets",
which would probably be very handy for what you want.

IHTH.

_________________
musher0
~~~~~~~~~~
Fidèle elle commença, ainsi elle restera. (Prov. canadien) /
Faithful she began, so will she stay. (Canadian prov.)
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5232
Location: Republic of Novo Zelande

PostPosted: Mon 15 Oct 2018, 03:30    Post subject:  

MochiMoppel wrote:
Nothing is impossible but ROX-Filer already can do what you ask for. Not good enough?
Hmmm, well I'm actually asking "on behalf of a friend".

i saw another thread detailing the virtues of Irfanview and bemoaning the lack of some of it's features in Linux - and in that thread Perdido made the comment that mmview had many of the features requested by the thread O.P.

One of the features the O.P mentioned was thumbnails so i thought I'd ask the question about that possibility within mmview.

mmview has a lot of potential as an alternative to ROX-Filer so if thumbnailing is possible it would be a handy inclusion. I know you label it as a "file viewer" but perhaps the ability to also offer a thumbnail view of a directory could be handy.

Actually - sometimes it would be really handy to have a pictorial/thumbnail view of every file in a directory, not just images (eg a pdf file displayed with an "adobe pdf swipe" (or just a ".pdf" icon), a text file displayed with a .txt icon etc

(sorry - my mind is running away as it usually does Smile )
txt_icon.png
 Description   
 Filesize   1.38 KB
 Viewed   209 Time(s)

txt_icon.png

pdf_icon.png
 Description   
 Filesize   1.36 KB
 Viewed   207 Time(s)

pdf_icon.png

Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5232
Location: Republic of Novo Zelande

PostPosted: Mon 15 Oct 2018, 03:37    Post subject:  

MochiMoppel wrote:
Nothing is impossible but ROX-Filer already can do what you ask for. Not good enough?
Now that I think about your remark a second time I realise that i had no clear recall of ROX-Filer having that ability. To be honest I would not want to modify the ROX settings each time I wanted to see the thumbnails - however if that ability could be switched on and off within mmview (maybe an extra icon in the cluster at top right?) it would seem to be a more appropriate place to find that function.

Somehow, I don't expect anything more of ROX-Filer than it's ability to take me to a directory and let me manually handle the files. It's not the most functional FM in the world (I have an xfe pet for more fancy file manipulations).
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1663
Location: Japan

PostPosted: Tue 16 Oct 2018, 04:36    Post subject:  

greengeek wrote:
Now that I think about your remark a second time I realise that i had no clear recall of ROX-Filer having that ability.
Then let me refresh your memory.
MMview and ROX-Filer work very fine as a combi.
1) Push button to open ROX-Filer window
2) In ROX-Filer window, If thumbnails are switched off, turn them on by right-clicking the eye icon. Use the '=' key to make thumbnails bigger.
3) Drag thumbnail from ROX-Filer to MMview to select in MMview.

Generating 500 thumbnails took only a few seconds. Neat, isn't it?
ROX-thumbnails.jpg
 Description   
 Filesize   144.42 KB
 Viewed   176 Time(s)

ROX-thumbnails.jpg

Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5232
Location: Republic of Novo Zelande

PostPosted: Tue 16 Oct 2018, 14:07    Post subject:  

MochiMoppel wrote:
2) In ROX-Filer window, If thumbnails are switched off, turn them on by right-clicking the eye icon. Use the '=' key to make thumbnails bigger.

Neat, isn't it?
Yes, very neat! Thanks!
Back to top
View user's profile Send private message 
bigpup


Joined: 11 Oct 2009
Posts: 11130
Location: Charleston S.C. USA

PostPosted: Tue 16 Oct 2018, 15:53    Post subject:  

This program is small enough to be made into a pet.
Be able to attach it in the first post of this topic.

Anything 256K or less can be attached to a post.

The mm_view_20180920.gz.
After removing the .gz.
The script file (mm_view_20180920) still needed to be given exec permission to run.

Would help to add that info in the download files description.

Nice program!!!

Looking like a real good possible Puppy file manager program.

_________________
I have found, in trying to help people, that the things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected Shocked
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 12820
Location: Gatineau (Qc), Canada

PostPosted: Tue 16 Oct 2018, 17:34    Post subject:  

Hello MochiMoppei and all.

You have indeed created in mm_view a fine generalist file-viewing and
file-handling utility. Many thanks for this program.

But with all due respect, IMHO, concerning mm_view as a picture viewer,
( q.v. http://www.murga-linux.com/puppy/viewtopic.php?p=1007473&sort=lastpost#1007473 )
if the user's defaultimageviewer script is configured correctly, it is simpler
to double-click on the image to view it full size in the defined viewer.
Further, if the defined image viewer is gqview, JIBS or mtpaint in viewer
mode, the user has direct access to image-processing features if needed.

My 2¢.

Best regards.

_________________
musher0
~~~~~~~~~~
Fidèle elle commença, ainsi elle restera. (Prov. canadien) /
Faithful she began, so will she stay. (Canadian prov.)
Back to top
View user's profile Send private message 
mikeslr


Joined: 16 Jun 2008
Posts: 2692
Location: 500 seconds from Sol

PostPosted: Tue 16 Oct 2018, 17:54    Post subject:  

bigpup wrote:
This program is small enough to be made into a pet.


I thought so too. The attached is for your consideration. The mm_viewer.desktop reads as follows (Edited, see below):

[Desktop Entry]
Encoding=UTF-8
Name=mm_file_info_viewer
Name[es]=mm_visor de archivos
Name[fr]=mm_visionneuse de fichiers
Icon=/usr/local/Pup-SysInfo/icons/Pup-SysInfo48.png
Comment=file information utility
Exec=/root/my-applications/bin/mm_view
Terminal=false
Type=Application
Categories=X-FilesystemUtility;
GenericName=File information utility

Don't hesitate to use or ignore it, or modify it -- especially regarding the names in Spanish and French generated by google-translate. To conserve overhead, it uses the same png as Pup-SysInfo, as that application exists in all recent Puppies.

I was sort of thinking about mm_viewer's graphic handling limitation without comparing it to other viewers. Rather, I noted that some files could be opened in the application which serves as default for its type, and that there was a tool to open text files, while graphic files could only be displayed, not edited.

Perhaps a tool to open a selected graphic file in the default graphic editor?

Edit: Based on musher0's analysis following, the Category designation has been changed so that the application will appear under filesystems. For ease of modification during development, I've left the binary in /root/my-applications/bin.
mm_file_viewer-20180920.pet
Description  File-Viewer and File-System Enhancement
pet

 Download 
Filename  mm_file_viewer-20180920.pet 
Filesize  17.69 KB 
Downloaded  0 Time(s) 

Last edited by mikeslr on Wed 17 Oct 2018, 19:34; edited 2 times in total
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 2270
Location: In The Way

PostPosted: Tue 16 Oct 2018, 18:12    Post subject:  

greengeek wrote:

Actually - sometimes it would be really handy to have a pictorial/thumbnail view of every file in a directory, not just images (eg a pdf file displayed with an "adobe pdf swipe" (or just a ".pdf" icon), a text file displayed with a .txt icon etc

(sorry - my mind is running away as it usually does Smile )


I used svg images to provide graphic image chooser for wifi APs and Network intefaces in Wifi-TrayNet. So it is very easy to do that (I mean if I can do it, imagine what Mochi could do ... but he wont anyway!)
xscreenshot-20181016T201125.png
 Description   
 Filesize   103.98 KB
 Viewed   70 Time(s)

xscreenshot-20181016T201125.png

xscreenshot-20181016T201021.png
 Description   
 Filesize   37.17 KB
 Viewed   69 Time(s)

xscreenshot-20181016T201021.png

Back to top
View user's profile Send private message MSN Messenger 
Display posts from previous:   Sort by:   
Page 16 of 17 [255 Posts]   Goto page: Previous 1, 2, 3, ..., 14, 15, 16, 17 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0824s ][ Queries: 12 (0.0120s) ][ GZIP on ]