PDA

View Full Version : Dumb IMG Viewer by me


Pac-Man
24 Apr 2011, 17:11
I was bored and wanted to program an image viewer, focussing on the techincal aspect (that's why it has a log pane).
It can extract the IMG files to more common image formats like PNG (no big deal with .NET) and should also be capable of reading Worms2 images which are a bit different from the other ones. Uses the decompression algorithm from Pisto:
http://img.webme.com/pic/i/imagesmicrosoft/imgviewer.png

S. also http://worms2d.info/Image_file and http://worms2d.info/Team17_compression .

It was actually part of Worms Studio (hence the weird icon) but since I never get that big fish done I now extract all its modules one by one.

It's written in C# :mad:.

You can find it in the attachment. Use it at your own risk and report bugs :P

Updated it: Now it's faster, accepts files via command line (e.g. you can link .IMG files to this program and it will open them), nice details pane and optimized usability.
Update 2: Now with shell thumbnail integration.

Download link: http://vibeware.highfsb.com/download/imgviewer/imgviewer.zip

GreeN
24 Apr 2011, 18:47
Nice work!

Now just add a bulk conversion feature :D

Pac-Man
24 Apr 2011, 18:50
Actually I'm planning a shell integration to preview IMG files in the explorer directly. But I'm optimizing the speed of drawing the images first.

GrO
24 Apr 2011, 19:23
So it can be used to save a large (unstandard sized) *.BMP map as a proper 8 bit *.PNG file.

Good job then, useful after system format, when You're too lazy to install some gfx apps ;]

Pac-Man
24 Apr 2011, 19:24
Wait, it only opens IMG files, not BMP files.
You can then save them as BMP, PNG or JPG (JPG with dull compression).
Reading got now 2000% faster due to "unsafe" procedure ;D .NET is never the whole deal...

GrO
24 Apr 2011, 19:33
Would be nice, if You'd extend it to open BMP files too.

Pac-Man
24 Apr 2011, 19:36
Would be easy, but that's not what this application has been written for^^

GrO
24 Apr 2011, 19:40
Would be easy, but that's not what this application has been written for^^

So write a separate app for it ;]

Pac-Man
24 Apr 2011, 19:42
O_O there are hundreds of image converters out there. just search them.

CyberShadow
24 Apr 2011, 20:48
I'd just like to mention something that's not immediately obvious: you can convert .img files to .png with W:A alone. To do this, place the .img in your SavedLevels folder, then load it in W:A's map editor and save it again, it will save as a .png file.

Pac-Man
24 Apr 2011, 21:10
Updated the program, now it's at least a little bit useful by showing the data nicely instead of a log ;)

GrO
24 Apr 2011, 21:25
O_O there are hundreds of image converters out there. just search them.

I'm using PhotoShop, so I don't really need any of those, but i meant You to write simple and lite app with WA dedicated HUD for newbies i.e. ;]

Pac-Man
24 Apr 2011, 21:30
No, but maybe CyberShadow has time for that (bad joke here).

EDIT: The shell integration works, but only while the program is running. Very weird... I've now updated it once again,.
http://img.webme.com/pic/d/dr-chat/thumbnails.png

Explorer
28 Apr 2011, 13:54
It's a pity that the shell integration doesn't work in XP. :(

But when I see this I come up with an idea: Merging the shell integration with CyberShadow's Thumbnail Shell Extension (http://worms2d.info/Thumbnail_Shell_Extension). Is it possible? I'm unfamiliar with the code and just curious.

Pac-Man
28 Apr 2011, 17:32
No, that won't work with .NET and I'm not going to program something like that in C++ ;D

krdrt5360
15 Jun 2011, 00:36
HTTP 404 download removed link IMGViewer.zip :-(

Lex
15 Jun 2011, 05:34
Try getting it from the link in its WKB article (http://worms2d.info/IMG_Viewer).

Pac-Man
15 Jun 2011, 09:10
Oops yeah, forgot to update the link here. Image and webserves has been changed by me.

krdrt5360
29 Jun 2011, 14:42
Again HTTP 404 download removed link, run error Windows XP program?

Pac-Man
29 Jun 2011, 16:22
I've updated the link in the first post once again since the ZIP file now got her final position on my website.
And I don't know what you mean with your second sentence.

krdrt5360
27 Oct 2011, 20:15
Run program error then problem technical information:
AppName: img viewer.exe AppVer: 1.1.5.0 AppStamp:4e0b42d3
ModName: kernel32.dll ModVer: 5.1.2600.3541 ModStamp:49c4f7e4
fDebug: 0 Offset: 00012a6b

Pac-Man
28 Oct 2011, 23:21
Steps had a similar error last time. Can anybody else proof this? I'm not getting that one. And nothing special is (e.g. nothing except window creation) is happening at startup.

EDIT: I updated it a lil' bit: Please try again: http://vibeware.highfsb.net/download/imgviewer/imgviewer.zip

StepS
29 Oct 2011, 09:17
Steps had a similar error last time. Can anybody else proof this? I'm not getting that one. And nothing special is (e.g. nothing except window creation) is happening at startup.

EDIT: I updated it a lil' bit: Please try again: http://vibeware.highfsb.net/download/imgviewer/imgviewer.zip

No, doesn't work still. Gives the same error info

Pac-Man
29 Oct 2011, 09:20
K, then I don't know. Already catching errors caused by missing rights. Tried running it as administrator though?

StepS
29 Oct 2011, 09:24
Tried running it as administrator though?

Yes. http://forum.team17.co.uk/images/newsmilies/happy.gif

Pac-Man
29 Oct 2011, 10:18
After some more debugging I found the issue, one stack overflow (caused by auto-fitting the color lists column width, duh) and one registry key permission bug. Both not seen when running with debugger attached, and not seen completely on my system. However I tested it with Steps and on my virtual machine now too and now it finally works.
Here you can download 1.1.7.0: http://worms2d.info/IMG_Viewer

viknash
8 Mar 2012, 17:16
Hi, can the tool open img files from Addiction Pinball or Worms Pinball ?

Pac-Man
10 Mar 2012, 09:42
You could only try. I don't know if the Worms img file format differs from the other ones.