Normal Topic Picture Names (Read 761 times)
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Picture Names
Oct 29th, 2005 at 4:11pm
Print Post Print Post  
Hi -

I saved a picture in my "standard" pic directory as
    John B. Smith.jpg
and when I went to "insert" the path into my database image element, the image name was not listed.  I checked in Windows Explorer and, sure 'nuff, t'was there. 

I must have wasted a good 10 or 15 minutes trying to resave and insert the picture when it finally dawned on me that this happened to me before. 

As soon as I renamed the picture WIHOUT the period after the initial "B" as
    James B Smith.jpg
everything was fine.

I just wanted to point this out so that other people don't have the same problem.

Also, I am curious -- is this something peculiar to Sesame?  Can it be fixed?

Thanks!
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Picture Names
Reply #1 - Oct 29th, 2005 at 5:06pm
Print Post Print Post  
Quote:
As soon as I renamed the picture WIHOUT the period after the initial "B" as
    James B Smith.jpg
everything was fine.

I just wanted to point this out so that other people don't have the same problem.

Also, I am curious -- is this something peculiar to Sesame?  Can it be fixed?

It is not peculiar to Sesame - it is one of the strangenesses of Windows / DOS - in the both MS OSs use the period to indicate that the filename is over and that the extension has begun. Sesame looks for the extension when filtering files by type (i.e.: ".jpg", ".bmp", ".dat", ".txt", etc...) to recognize the file type.

Linux, and all OSs not created by MS, store the file type separately from the filename, nor particularly use or require an "extension". In other words, they know that an ".exe" is executable, even if it has no particular extension.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: Picture Names
Reply #2 - Oct 29th, 2005 at 5:22pm
Print Post Print Post  
Mark -

I appreciate your explanation; however, I am still a little confused.

Apparently there is no problem with Windows per se because the file name John B. Smith.jpg is not a problem for any other program I use.  It was there in Windows Explorer and I could retrieve it without any problem. It was there in Microsoft Picture It Express and I could retrieve it without any problem.  After reading your eply, I even opened a word document, selected Insert/File and both pictures appeared whether the name contained the "extra" period or not.

I can understand that Sesame might look for the file extension after the period, but couldn't it simply be programmed to look for the LAST period (or put another way, start searching the file name from right to left to find the "first" period) .... and then interpret the file type? 

It's not a "biggy" but it would certainly be an enhancement to the software if we didn't have to worry about little nuances when saving a file.
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
walt
Member
*
Offline



Posts: 48
Joined: Nov 30th, 2002
Re: Picture Names
Reply #3 - Oct 29th, 2005 at 7:17pm
Print Post Print Post  
Good work Spenser!
Thanks for pointing this out. Will save me some agony.
Man, you're really on a roll today.  Grin
Walt Z. Period-Comma.jpg
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Picture Names
Reply #4 - Oct 29th, 2005 at 7:26pm
Print Post Print Post  
We don't look for any periods. We ask the OS to return a list of files with a particular extension (often called a "filter" in MS). The OS returns that list based on where it finds the extensions.

What I meant by a problem with extension is that MS (and only MS) uses extensions as the sole means by which to indentify file type. You can name a file "whatever.jpg", even if it is a text file, and MS will treat it from that day forward as though it was a jpeg image - and fail, because its a text file.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Picture Names
Reply #5 - Oct 29th, 2005 at 10:43pm
Print Post Print Post  
Perhaps a little program in 'on element exit' could rename the file and revise the image LE to match the new filename...something like like (untested):

On element exit:
if Image <> "" then
{
var vNewName as string
var vimage as string
var nn as int

if image <> "" then
{
vimage = @repllas(image, ".", "*") //replace last period with asterisk
VNewName = @replace(split(vimage, "*"), ".","_")+".jpg" //replace periods with underscores
nn = @shell("rename "+ @imagepath() + image +" "+ VNewName)
image = vNewName
forceredraw()
}
}

Of course, if you would have to drag and drop the image into sesame since you can use the built in 'viewer' to find the photo Sad

steve
« Last Edit: Oct 29th, 2005 at 11:48pm by Steve_in_Texas »  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Picture Names
Reply #6 - Oct 30th, 2005 at 12:21am
Print Post Print Post  
Spencer,

I built you a popup image browser. Put it in a command button to give the user a popup menu displaying all .jpg and .gif images in a certain folder. Tweak as needed:

Command button-On Element Entry:

var a as int
var b as string
var vline as string
var vdata as string
var c as string

a = @shell("dir/b "+ @imagepath() +" > c:\files.txt")
b = @insert("C:\files.txt")

while @len(b) > 0
{
vline = split(b, @newline())
if @right(vline,4) = ".jpg" or @right(vline,4) = ".gif" then
vdata = @appendstringarray(vdata,vline)
}

c = @popupmenu(vdata,"Please select image file")
if c <> "" then image = c


Steve

Edit: It should be caledl a 'popup file browser' since you can't preview an image while your browsing....bummer.
« Last Edit: Oct 30th, 2005 at 4:24am by Steve_in_Texas »  
Back to top
IP Logged