|
According to some braniac, if you open an imagefile and edit it you are not permitted to save it as the file is locked.
That's an hour of headbanging I'm not getting back in a hurry!
veni bibi saltavi
|
|
|
|
|
If you mean in code, then yeah - in .NET at least that has been the case since V1.0: Image.FromFile Method (String) (System.Drawing)[^]
Quote: The file remains locked until the Image is disposed.
Simplest solution:
public static Image GetImage(string path)
{
using (Image im = Image.FromFile(path))
{
return new Bitmap(im);
}
}
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
That's the solution I reached in the end.
But f'me, it's pretty damned stupid. If they're going to lock i, why not let you programatically open the image for r/w?
veni bibi saltavi
|
|
|
|
|
This is Microsoft we are talking about, and a boring bit of code.
They probably got the office junior to write it, and he got the code from SO...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
OriginalGriff wrote: and he got the code from SO...
there's people making good money doing that... the hardest part is beating the job interview.
Signature ready for installation. Please Reboot now.
|
|
|
|
|
Depressing, but true.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
If you have the file still open, you should be able to overwrite it's contents. Of course, you do have to have opened it for writing. If you're trying to simultaneously open the file a second time for writing and change its contents.. well.. that way lies bugs, which is why you're not allowed to do such dumb things.
|
|
|
|
|
patbob wrote: If you have the file still open, you should be able to overwrite it's contents. You can't if the file is locked.
So throw away your image instead of choosing "save as"
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
You think that's bad? (Yeah, it is.) PhotoShop refuses to write to my NAS. I have to store locally, then move the file.
|
|
|
|
|
PIEBALDconsult wrote: PhotoShop refuses to write to my NAS. I have to store locally, then move the file.
If your operating system has no problem writing to the NAS then but PhotoShop cannot... then I would suspect that PhotoShop is using its own SMB implementation. It may be attempting a SMBv1 connection[^] to your network storage device.
Best Wishes,
-David Delaune
|
|
|
|
|
That's rather horrible if that's the case. Why would any app even care? This should be completely abstracted away by the OS.
|
|
|
|
|
dandy72 wrote: This should be completely abstracted away by the OS.
Yeah. I completely agree.
Note that I am guessing here; but because most of the PhotoShop wielding graphics artists I've met were on Mac OSX[^] I am assuming that the PhotoShop SMB implementation is probably cross-platform.
Best Wishes,
-David Delaune
|
|
|
|
|
Randor wrote: probably cross-platform
Obviously it failed.
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
Randor wrote: .. I would suspect that PhotoShop is using its own SMB implementation Photoshop doesn't have an SMB implementation built in, that'd be silly. More likely, is that the NAS is using ext3 and it's SMB implementation isn't mapping all the SMB features to the foreign filesystem (or the foreign filesystem can't support them). If Photoshop is using one of those SMB features, then it might indeed faila write, not because Photoshop is deficient, but rather because the NAS is deficient. I've had to debug that exact issue before, twice, albeit not with Photoshop.
|
|
|
|
|
No save as options? No way of copying it to the clipboard, and save it using MSPaint?
It's a bug btw, due to lack of understanding; if it had been tested to see if basic functionality is at least available, it would have been caught. What buggy, untested software are you using if "Save As" and copy to clipboard aren't even available?
You do know that there is a free, open OS that has some decent image-editors, also for free?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
One reason may be that the image contents aren't loaded entirely in memory. While this may not be necessary for small images, it may be desired for large images.
|
|
|
|
|
Usually a save occures some time after the opening; most applications do not even allow edit before opening is done. So, unlikely.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Are cartoons the road trip playlist?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Were fartoons the reason that Smell-O-Vison never became a hit?
... such stuff as dreams are made on
modified 19-Feb-18 11:32am.
|
|
|
|
|
The evolution of films (movies):
- Pictures move!
- Pictures talk!
- Pictures stink
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack.
--Winston Churchill
|
|
|
|
|
Hmmmm,
Is your third point a verb or a proper noun: Smell-o-Vision[^]?
Best Wishes,
-David Delaune
|
|
|
|
|
If you've seen any films (movies) recently, the question should answer itself.
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack.
--Winston Churchill
|
|
|
|
|
Yes. Used on the way to the festoon.
|
|
|
|
|
you went to comic con? how much did they get from you?
got a sad email from sveta, she is looking for a friend or kind soul to help her...
she wrote that she has no money for gas and so was very cold.
Well that makes no sense.
|
|
|
|