Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 12th January 2011, 03:28   #1
manasi1128
Junior Member
 
Join Date: Sep 2010
Posts: 19
Question get the size for image files.....

Hi,

I want to get the size of .png files..... GetFileSize gives the size of .dll,.exe but gives 0 kb for .png files.....plzz help....
thnx in advance..!!!
manasi1128 is offline   Reply With Quote
Old 12th January 2011, 05:53   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,841
GetFileSize always gives the file size, no matter what file type it is. If you get zero, then probably the file doesn't exist or it's of zero size. Or maybe it's locked and can't be opened.
MSG is offline   Reply With Quote
Old 12th January 2011, 06:00   #3
Joel
Debian user
(Forum King)
 
Joel's Avatar
 
Join Date: Jan 2003
Location: Arch land
Posts: 4,896
This works ok, in my XP box:
code:

Name "png_size"
OutFile "png_size.exe"
ShowInstDetails show

Function FileSizeNew

Exch $0
Push $1
FileOpen $1 $0 "r"
FileSeek $1 0 END $0
FileClose $1
Pop $1
Exch $0

FunctionEnd

Section -
Push "C:\joel\sshot-1.png"
call FileSizeNew
Pop $0
DetailPrint "$0 bytes"
SectionEnd


But, I notice when using like this:
Returns this:
code:

Section -
Push "C:\joel\Mis imágenes\sshot-1.png"
call FileSizeNew
Pop $0
DetailPrint "$0 bytes"
SectionEnd


Quote:
C:\joel\Mis imágenes\sshot-1.png bytes
Completed
Bug?

FileSizeNew wiki.


* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux w/ xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Debian unstable w/ xfce4.
Joel is offline   Reply With Quote
Old 12th January 2011, 07:41   #4
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,841
Hmm. I use that function with spaces without trouble. Perhaps the accent on imagines is causing the problem? Try the unicode build.
MSG is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump