467,894 Members | 1,585 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,894 developers. It's quick & easy.

simple question I think.

Hello,
I was having a problem saveing images that I edited with a vb.net
program. Every time I would save the image I would receive a GDI+ error. I
tried everything that I could think of including copying the photo album to
my local drive and I still kept getting the errors. Finally I tried copying
out only the folder that contained the images that I wanted to update and
everyting worked great. Here is the question. How man levels down can you
save a file in a directory? When I tried to save the file 5 levels down I
received an error. This could cause a problem because the photo album is
being used by legacy apps, and I can not change the structure of the album,
unless I want to change a couple of RPG programs (which I do NOT want to do).
Is there any way around this?

ex) c:/level2/level3/level4/level5/image.jpg ---> doesn't work

c:/level2/level3/image.jpg ---> works
Nov 21 '05 #1
  • viewed: 954
Share:
6 Replies
Hi Brian,

There should be no restrictions.

Can we see your code?

Bernie Yaeger

"Brian" <ja*****@amc.com> wrote in message
news:7E**********************************@microsof t.com...
Hello,
I was having a problem saveing images that I edited with a vb.net
program. Every time I would save the image I would receive a GDI+ error.
I
tried everything that I could think of including copying the photo album
to
my local drive and I still kept getting the errors. Finally I tried
copying
out only the folder that contained the images that I wanted to update and
everyting worked great. Here is the question. How man levels down can
you
save a file in a directory? When I tried to save the file 5 levels down I
received an error. This could cause a problem because the photo album is
being used by legacy apps, and I can not change the structure of the
album,
unless I want to change a couple of RPG programs (which I do NOT want to
do).
Is there any way around this?

ex) c:/level2/level3/level4/level5/image.jpg ---> doesn't work

c:/level2/level3/image.jpg ---> works

Nov 21 '05 #2
Here is an example
bmpImage.Save("C:\photos\00\00\" & x2 & "\0000" & x2 & y2 & ".jpg")
bmpImage.Save("C:\00\" & x2 & "\0000" & x2 & y2 & ".jpg")

The first line with 2 extra directories fails with a GDI error and the
second one works. If there is no directory issue, I am stumped. I can read
from the first one, but not save to. The second one is just a copy of the
"00" folder put in the C drive.

Any ideas?
"Bernie Yaeger" wrote:
Hi Brian,

There should be no restrictions.

Can we see your code?

Bernie Yaeger

"Brian" <ja*****@amc.com> wrote in message
news:7E**********************************@microsof t.com...
Hello,
I was having a problem saveing images that I edited with a vb.net
program. Every time I would save the image I would receive a GDI+ error.
I
tried everything that I could think of including copying the photo album
to
my local drive and I still kept getting the errors. Finally I tried
copying
out only the folder that contained the images that I wanted to update and
everyting worked great. Here is the question. How man levels down can
you
save a file in a directory? When I tried to save the file 5 levels down I
received an error. This could cause a problem because the photo album is
being used by legacy apps, and I can not change the structure of the
album,
unless I want to change a couple of RPG programs (which I do NOT want to
do).
Is there any way around this?

ex) c:/level2/level3/level4/level5/image.jpg ---> doesn't work

c:/level2/level3/image.jpg ---> works


Nov 21 '05 #3

"Brian" <ja*****@amc.com> wrote
Here is an example
bmpImage.Save("C:\photos\00\00\" & x2 & "\0000" & x2 & y2 & ".jpg")
bmpImage.Save("C:\00\" & x2 & "\0000" & x2 & y2 & ".jpg")

The first line with 2 extra directories fails with a GDI error and the
second one works. If there is no directory issue, I am stumped. I can read
from the first one, but not save to. The second one is just a copy of the
"00" folder put in the C drive.

Any ideas?


Verify that you you have write access to the folder and if all else fails,
try setting the working drive and directory to the one you want and
save the file by just using its name. (See ChDrive and ChDir to change
the current drive and directory).

LFS
Nov 21 '05 #4
"Brian" <ja*****@amc.com> schrieb:
I was having a problem saveing images that I edited with
a vb.net program. Every time I would save the image I
would receive a GDI+ error.
[...]
ex) c:/level2/level3/level4/level5/image.jpg ---> doesn't work

c:/level2/level3/image.jpg ---> works


Are you really using "/"? Replace them with "\". If this doesn't help:
Are you sure, the directories exist?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #5
Nope, sorry. My fingers just got ahead of the brain. I am using \.

"Herfried K. Wagner [MVP]" wrote:
"Brian" <ja*****@amc.com> schrieb:
I was having a problem saveing images that I edited with
a vb.net program. Every time I would save the image I
would receive a GDI+ error.
[...]
ex) c:/level2/level3/level4/level5/image.jpg ---> doesn't work

c:/level2/level3/image.jpg ---> works


Are you really using "/"? Replace them with "\". If this doesn't help:
Are you sure, the directories exist?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #6
Les
Brian,
I had a very similar problem to what you are having. What I cam up with was
2 differenct fixes, one for VB and one for C#. What I had to do in VB to get
things to work (I have 7 levels of directories) is to assemble the path in a
string before the actual function call, and then put the sting in the
function -- I know, extra line of code, but it worked for me. With C# I had
to add the "@" before the string showing it was a constant string and then
add the file name after. Took 1 more line of code than the VB answer. I
don't know why it didn't work in the function, but once the path and file
name were assembled out of the function in a string variable, things were
fine.

"Brian" wrote:
Nope, sorry. My fingers just got ahead of the brain. I am using \.

"Herfried K. Wagner [MVP]" wrote:
"Brian" <ja*****@amc.com> schrieb:
I was having a problem saveing images that I edited with
a vb.net program. Every time I would save the image I
would receive a GDI+ error.
[...]
ex) c:/level2/level3/level4/level5/image.jpg ---> doesn't work

c:/level2/level3/image.jpg ---> works


Are you really using "/"? Replace them with "\". If this doesn't help:
Are you sure, the directories exist?

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

27 posts views Thread by Brian Sabbey | last post: by
3 posts views Thread by Patchwork | last post: by
13 posts views Thread by Michael B Allen | last post: by
51 posts views Thread by Alan | last post: by
7 posts views Thread by Mark Prenter | last post: by
10 posts views Thread by serge calderara | last post: by
18 posts views Thread by Sender | last post: by
18 posts views Thread by Bob Cummings | last post: by
11 posts views Thread by samuelberthelot | last post: by
17 posts views Thread by Chris M. Thomasson | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.