ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Cannot create file ...The system cannot find the path specified

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
brm121966 Posted - Jul 20 2022 : 21:59:52
Hi.

I am trying to save the file ImageEnView1.IO.SaveToFile(OutputFilename, ioPNG);

OutputFilename := "\\As6204t-e169\MAIN\MUSIC\Jazz\Ben Webster\Ben Webster with strings MUSIC FOR LOVING 2 CD#1103;s + Folders mp3pro.320kB\Folder.png";

The string contains the character (see image).

I get an error. Cannot create file "\\As6204t-e169\MAIN\MUSIC\Jazz\Ben Webster\Ben Webster with strings MUSIC FOR LOVING 2 CD#1103;s + Folders mp3pro.320kB\Folder.png". The system cannot find the path specified

If you remove the character, the procedure saves the file. Is there a way to fix it without fixing the file path?

Thanks.





Rudolf

11   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jul 28 2022 : 23:16:25
Thanks for the update, Rudolf,

Nigel
Xequte Software
www.imageen.com
brm121966 Posted - Jul 28 2022 : 19:19:48
Hi Nigel.
I'm sorry. This is my bug. In the code, replacing the name also changed the value in the path. Please delete the forum thread.
I apologize again.
ImageEn is the best.

Rudolf
xequte Posted - Jul 28 2022 : 00:54:49
Hi Rudolf

Network locations work fine for me too.

Please add this code before SaveToFile:

  if DirectoryExists( ExtractFilePath( OutputFilename )) = False then
    raise Exception.create( 'Directory not found: ' + ExtractFilePath( OutputFilename ));


Nigel
Xequte Software
www.imageen.com
brm121966 Posted - Jul 25 2022 : 18:04:10
Hi Nigel.
Run your exe. See screenshot.
Maybe save doesn't work with a network folder?

P.S.
Tried to save before conversion, Saving works.

Rudolf



xequte Posted - Jul 24 2022 : 18:07:46
Hi Rudolf

I called your code with a the text of a TEdit containing a unicode string and it converted without error for me:

www.imageen.com/temp/UniTest.zip

Nigel
Xequte Software
www.imageen.com
brm121966 Posted - Jul 24 2022 : 09:35:37
Hi Nigel.

function Convert_Image(InputFilename: string): boolean;
var
  w, h: integer;
  OutputFilename: string;
  ImageEnView1 : TImageEnView;
begin
  result := false;

  ImageEnView1 := TImageEnView.Create(nil);
  with ImageEnView1 do begin
    IO.LoadFromFile( InputFilename );

    w := 375;        
    h := 375;
    with Proc with begin
        Resample(w, h, rfLanczos3, True);
        ConvertTo(256, ieThreshold); 
        Sharpen(10,4);
    end;

    IEBitmap.PixelFormat := ie8p; 
    IEGlobalSettings().AutoSetBitDepth := True;

    OutputFilename := ReplaceStr(InputFilename,'Cover','Folder'); 
    OutputFilename := ReplaceStr(OutputFilename,'.jpg','.png');

    IO.Params.PNG_Compression := 9;
    IO.SaveToFile(OutputFilename, ioPNG); 
    Free;
  end;

end;



Rudolf
xequte Posted - Jul 23 2022 : 00:26:04
Hi Rudolf

Please give me some steps to reproduce the issue here.

Nigel
Xequte Software
www.imageen.com
brm121966 Posted - Jul 22 2022 : 18:05:05
Hi Nigel.
Did as you advise.
Read property edit.text, ImageEnView1.IO.Params.FileName.
These properties are equal to the LoadFromFile parameter.
The file is loading correctly.
Then I change the filename and convert the size and palette of the file.
An error occurs while writing the file.
I use Delphi XE5


Rudolf
xequte Posted - Jul 21 2022 : 22:50:56
Hi Rudolf

If you copy the path to a TEdit at runtime, I assume it displays correctly (with the reversed R).

Then if you click a button using this code:

ImageEnView1.IO.LoadFromFile( edit1.Text );

Does it load correctly?

What version of Delphi are you using?

Nigel
Xequte Software
www.imageen.com
brm121966 Posted - Jul 21 2022 : 22:05:42
Hi Nigel.
I'm sorry, but this doesn't work.
Cannot create file "\\As6204t-e169\MAIN\MUSIC\Jazz\Ben Webster\Ben Webster with strings MUSIC FOR LOVING 2 CD'#1103's + Folders mp3pro.320kB\Folder.png". The system cannot find the path specified.
The characters #1103 appeared after inserting a line into a post in this forum. Part of the real line in the picture of the previous message.
What's the problem, any ideas?
Thank you.


Rudolf
xequte Posted - Jul 21 2022 : 03:16:24
Hi Rudolf

If you put a unicode string value inside quotes in Delphi it will use the literal value of that, i.e. #1103;

So you need to move it outside the quotes:

OutputFilename := '\\As6204t-e169\MAIN\MUSIC\Jazz\Ben Webster\Ben Webster with strings MUSIC FOR LOVING 2 CD'#1103's + Folders mp3pro.320kB\Folder.png';


Nigel
Xequte Software
www.imageen.com