April 25, 2024, 01:46:16 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Slideshow

Started by GWS, April 19, 2016, 01:22:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

GWS

April 19, 2016, 01:22:46 PM Last Edit: April 20, 2016, 05:39:24 PM by GWS
Hi Folks,

Having moved back to nice quiet XP, one other thing I missed from Win7 is the image slideshow facility.

So here again, I've rolled my own  ;D

I've cobbled it together with assorted code from the past - some of which I've modified - and it seems to work (more by luck than judgement I think) ::)

Some of the code is from TronDoc's method of analysing images in 2002.  How it works I'm not sure  :)
Trondoc worked directly on the image files - I've chosen to read the whole file into a buffer, and work on that.

You can point it at any folder containing jpeg and bmp images.  Other file types will be ignored.

The intro window allows you to select Random or Sequential display, at various intervals.

Images are scaled to fit the screen, although scaling is limited to twice normal size to avoid pixelation.

While the slideshow is running, pressing the Spacebar will pause the display - pressing it again continues.

Press ESC or Q to exit the program.

Some images, particularly those from modern cameras, can be of huge size (4000px or so).  Even Microsoft's Photo Editor won't open those.  Also some jpeg images from years ago, appear to have several strange formats.  The whole jpeg file format is odd.  Finding the dimensions is a real voyage of discovery.
You would think there would be a better way - if so I haven't yet found it.

If one of your favourite shots fails to load - try loading it into another graphics program like Photoshop, and then saving it again as either a bmp(lossless) or compressed jpeg.  Then it should load, once the format is of a more standard format.

Hope it works for you - I'm quite pleased with it ..

Best wishes, :)

Graham

Tomorrow may be too late ..

Bill-Bo

Graham,

I like it. Is it okay to put it only a CD or DVD to give to someone to view the pictures on it?

Bill

GWS

April 19, 2016, 06:12:14 PM #2 Last Edit: April 19, 2016, 06:25:51 PM by GWS
Hi Bill,

Of course you can ..  ;D

Anything I write, you can use however you like.  I just realised though - I haven't included the source code  ::)

I was too sleepy I guess ..  :P  I'll re-zip it and replace the above .zip file.  Give me a moment.

All the best,

Graham.

[OK - the source code is there as well now ..  ;D]
Tomorrow may be too late ..

Bill-Bo


Egil

Great program Graham!

There is a minor snag though. I tried to let your program show unedited jpg files just collected from my digitalcamera. This resulted in messageboxes popping up instead of the pictures. The messageboxes showed different error messages, all of them saying that something was missing.
When I mixed these pictures  with pictures that had been loaded into PhotoFiltre and saved again with the same name, the error messages dissapeared if the checkbox saying "Preserve EXIF/IPTC data" was unchecked.
I don't know much about such EXIF/IPTC data tags, but my grandson says they contain information of the hardware used with the equipment used to produce the picture.

But used with selected "safe" pictures (stripped of the EXIF/IPTC data tags), your code is a very strong candidate to become my future screensaver...

Thanks for sharing!


Support Amateur Radio  -  Have a ham  for dinner!

GWS

Hi Egil,

Glad you like it ..  :)

I knew digital camera files were not readable unless passed through a graphics program that can strip all that 'snooper' data from the image files.  Most of my graphics programs are quite old, so they did not incorporate the metadata of camera settings, date, time, GPS location etc. in the image files.

All this extra data embedded in the images, means the analysis of the file according to historic structure, fails to find the Width and Height details.

I put my files that show this unfriendly behavior, through a graphics program that can remove all the photographic and snooper data, leaving just the basic image information. Then the files can be analysed correctly.  I use an old Photoshop version which does this automagically - but I imagine other photo programs can do this.

Best wishes, :)

Graham

Tomorrow may be too late ..

Egil

Hi Graham,

QuoteAll this extra data embedded in the images, means the analysis of the file according to historic structure, fails to find the Width and Height details.

When I started working with my IWB MapView project last year, I noticed that some of the downloaded map files (all jpg) would give me problems when trying to adjust their sizes to fit the programs clientarea.
Never found the reason for the problems at the time, but when checking now, I found that the problem files all contained these tags. So guess the first thing I have to do when feeling fit to start coding again, is try to make a routine that will filter out these hardware tags when calculating the pictures height and width.

For my own pictures, I think my camera can be set to avoid saving these tags. I'll check tomorrow. Getting kind of late here now...


73'
Egil
Support Amateur Radio  -  Have a ham  for dinner!

GWS

April 22, 2016, 02:58:29 AM #7 Last Edit: April 22, 2016, 03:02:57 AM by GWS
Hi Egil,

What a mess it all is ..  ::)  I hate the high-tech digital World.

The Exif data stored in modern camera files, is a bad problem - often specific to the camera manufacturer.
Makes it pretty well impossible to decode the files ..

Here are a few notes I've found:

Quote
The derivation of Exif from the TIFF file structure using pointers in the files means that data can be spread anywhere within a file - which means that image software is likely to corrupt any pointers or corresponding data that it doesn't decode/encode. For this reason most image editors damage or remove the Exif metadata to some extent upon saving.

As the tag contents are proprietary and manufacturer-specific, it can be difficult to retrieve this information from an image or to properly preserve it when rewriting an image.

The Exif standard specifically states that color depth is always 24 bits.[12] However, some modern cameras can capture more data such as the Nikon D70 which captures 36 bits of color per pixel. Since Exif/DCF files cannot represent this color depth, manufacturers have developed proprietary, non-compatible raw image formats.

Photo manipulation software sometimes fails to update the embedded thumbnail after an editing operation, possibly causing the user to inadvertently publish compromising information.

Some camera manufacturers have developed non-standard techniques for storing the preview images used by some digital cameras for LCD review. These non-standard extensions are commonly lost if a user re-saves the image using image editor software.

Since the Exif tag contains metadata about the photo, it can pose a privacy problem. For example, a photo taken with a GPS-enabled camera can reveal the exact location and time it was taken, and the unique ID number of the device - this is all done by default - often without the user's knowledge.

Specialist software may be required to remove the Exif tag before publishing. For example, a whistleblower, journalist or political dissident relying on the protection of anonymity to allow them to report malfeasance by a corporate entity, criminal, or government, may therefore find their safety compromised by this default data collection.

According to documents leaked by Edward Snowden, the NSA is targeting Exif information under the XKeyscore program.[20]

The privacy problem of Exif data can be avoided by removing the Exif data using a metadata removal tool.

It's a mad World.  Probably best to switch it off on your camera - if you can  :o

All the best, :)

Graham
Tomorrow may be too late ..

Egil

Hi Graham,

That is just about the same I found out this morning.
But fortunately all these additional tags can be removed by right-clicking the file name and choose properties. Under the "Details" pane, one of the choices is "Remove additional information tags" (translated from norwegian)...

On one of my two cameras, it is possible to turn these tags off. But on my compact pocket  camera, which I always carry in my jacket, there is no provision for turning it off. If there is, I have not yet found it.
I haven't bothered to check the smartphone. Why are they doing it so difficult? Most people do not need this information anyway.

And... you are quite right. It is a mad world.
Support Amateur Radio  -  Have a ham  for dinner!