Top

Typos ViewPic


mIRC Code
+ 18 likes
Please Register to submit score.
Bookmark and Share
Average Score  9.4 (of 19 scores)
Date Added  Aug 20, 2008
Last Updated  Sep 21, 2008
Tags  album  bmp  gif  image  jpeg  jpg  photo  photograph  pic  picture  picwin  png  slideshow  typo  view  viewer  viewpic  zoom 

Description

Typos ViewPic makes viewing pictures inside of mirc a breeze. To view a picure in mirc you simply double click a link to a photo online or type /ViewPic to launch the file selection dialog so you can choose your photo or you can follow /ViewPic with the Drive:\Path\To\filename.ext (eg. C:\Pictures\photo.jpg) of the picture you wish to view.

FEATURES

Photo Album:
The script has a built in photo album that will display 16 photos each page. To view any photo normally you simply double click it to open it in viewpic. You can select what folder to view and it will remember the folder for the next time you open the album. You can also delete files from within the photo album by single clicking a picture to select it and then using the delete button.

Zoom:
With the zoom feature you can zoom in by left clicking on the image. Wherever you click is where it will center the zoomed image. The first click will zoom to 1.5x, the second click zooms to 2x, the third click zooms to 2.5x and the click after that will return you to the normal view. Pressing any other key at any time during the zoom process will also return the view to normal.

Slideshow:
The slideshow feature. You can select "Start a slideshow" from any of the rightclick menus and also by using the slideshow button in the photo album. To stop the slideshow, simply hit any key or click with the mouse. The delay between photos is adjustable in the viewpic control panel and defaults at 4 seconds.
If you run the slideshow when a picture is not loaded it will default to the viewpic's save folder which is set in the control panel. If you start it by right clicking on a picture it will use the folder of the currently loaded picture and using the button in the photo album will start a slideshow in the whichever folder the photo album is in.

Scrolling:
You can scroll through the pictures in the folder of the currently loaded picture by pressing +, RightArrow or PgUp to go forward and -. LeftArrow or PgDn to go back or you can use the right click menu to scroll either way.

Fullscreen View:
While viewing a picture you can toggle between regular view and fullscreen at any time by double clicking the photo, pressing any key except for +, -, PgUp, PgDn, LeftArrow and RightArrow or by using the right click menu. You can resize the loaded picture to any size you wish. You can return to normal view the same way you switch between normal and fullscreen views. The animated gif's cannot be toggled to full screen or reized.

Online Picture Viewing/Automatic Downloading:
It supports links to pictures online by allowing you to just double click the link like normal to have the picture automatically downloaded and displayed right inside of mirc. This means no more opening a web browser just to view a picture.
When viewing an online photo you will be presented with a progress bar while the photo is downloaded incase its a large picture. This way you know the scripts working on loading your picture.

Animated Gifs:
I have added the ability to support animated gifs. It works with most animated gifs but a small amount cannot be displayed properly due to limitations in Mirc Picture Windows.
When it encounters an animated gif it cannot animate you will be notified and the first frame in the animation will be displayed. There may also be some lagging in very highly detailed animated gifs but most that were tested displayed just fine.

Resizing:
If the picture is larger than 90% of the screens resolution it will be stretched down to less than that. The amount of stretching will depend on the aspect ratio and size of the photo. All the pictures that are smaller than 90% of your resolution will be displayed at their original resolution. This prevents the picture from covering the Windows taskbar or the Mirc titlebar.

Saving Photos:
You can select whether or not to automatically save all downloaded pictures into the default /viewpic/ folder which the script will create on install or any folder of your choice.
You can right click when viewing a picture and select "Save the current picture as..." to save a copy of the picture. You will be prompted for the folder to save to and what to name it.

Custom Menus:
I had to rebuild the default right click menu that used to show up when you right click on a link to a picture since it was gone due to me taking over the double click action on those links. All other links were unnaffected. The replacement right click menu looks, feels and acts like a normal windows/mirc right click menu. The options are "Copy address", "Open in new browser window" and "Open in active window".

As usual, just paste the code into a new remote file and save. (Even when updating.)



*Updated 08/24/2008*
1. Added the ability to resize pictures and some minor bug fixes.

*Updated 08/28/2008*
1. Made a whole new timeout system that uses the http standard timeout scheme which times out if the speed falls below 150 bps. It also timesout after 2 minutes (adjustable).
2. The socket now has better handling of dead url's or links to files that arent really there but the server tries a redirect and I made improvements and fixes to the sockclose event.
3. Made fixes to the recently added resize system after I noticed a problem with it.
4. Changed the way the script stores the file name while running. It used to store the whole path and filename int he titlebar but since having only the filename there looks better I am now using a variable to store that info.
5. The script now remembers the last folder you were browsing in when loading a picture locally and opens in that folder the next time.
6. Now checks on install to make sure you are running mirc 6.3 or higher. (This means a future update will likely include moving "" back to $qt and going back to using noop. I was trying to make the script compatible with older versions but in the end had no luck.
7. On top of that there are a lot of various code changes and/or fixes throughout the entire script.

*Updated 09/04/2008*
1. Added a photo album. It displays 16 photos a page lets you simply double click a picture to open it in viewpic. You can select what folder to view and it will remember the folder for the next time you open the album. You can also delete files from within the photo album by single clicking a picture to select it and then using the delete button.
2. Added the ability to double click a picture to toggle between normal and fullscreen view as requested by zmodem.
3. Fixed a bug that wasn't copying the file like it was supposed to when the save downloads option was enabled (this problem was from the previous update).
4. Various other smaller bug fixes and coding updates.

*Updated 09/06/2008*
1. Added the ability to scroll forward and backword a picture at a time in the folder of the currently loaded picture using either +/-, PgUp,PgDn, LeftArrow/RightArrow or the right click menu. This is for when viewing photos normally, not in the photo album.
2. Added a button in the photo album to open the currently selected folder.
3. Fixed the file display in the photo album to not include the path since the path is already displayed up top.
4. Fixed the photo album dialog to display immediatley after deleting a file instead of loading the images and then making the dialog visible again.
5. Multiple minor visual fixes to the photo album dialog.
6. Fixed the On Load event to function properly.
7. Fixed the timeout system to avoid false timeouts.
8. Various other smaller bug fixes and coding updates.

*Updated 9/21/2008*
1. Added the ability to zoom in by left clicking on the image. Wherever you click is where it will center the zoomed image. The first click will zoom to 1.5x, the second click zooms to 2x, the third click zooms to 2.5x and the click after that will return you to the normal view. Pressing any other key at any time during the zoom process will also return the view to normal.
2. Added a slideshow feature. You can select "Start a slideshow" from any of the rightclick menus and also by using the slideshow button in the photo album. To stop the slideshow simply hit any key or click with the mouse. The delay between photos is adjustable in the viewpic control panel and defaults at 4 seconds.
...If you run the slideshow when a picture is not loaded it will default to the viewpic's save folder which is set in the control panel. If you start it by right clicking on a picture it will use the folder of the currently loaded picture and using the button in the photo album will start a slideshow in the whichever folder the photo album is in.
3. Fixed an error with the aspect ratio in the full screen view which went undiscovered until now due to the small amount of affected photos.
4. Various other smaller bug fixes and coding updates.

Be sure to unload the old copy and then load the new one when updating.

Grab the Code

;Typos ViewPic
;For use on mIRC 6.3 or higher.
;
;This script has many usefull pieces to it that can be used seperately with a little editing and in some cases even no editing at all. 
;For instance I designed the /ViewPicAll (originally going to be named pic2win) alias to work as a standalone alias for simple photo viewing.  Thats why /ViewPicAll supports gif even tho it wont ever be sent one in the script due to /ViewPicAG handling all gifs for animated gif support.
;The /ViewPicAG alias is also functional as a standalone for gif/animated gif support as long as you remember to grab the /ViewPicAG2 alias with it.  
;The socket event thats used to dynamically download the photo from any photo link that is double clicked could be very very easily edited to automatically download any file from a link pointing to a file online.
;And lastly, the Different events and aliases I used to recreate the right click menu could be a great example or template for creating menus just like it.  To be clear, this is no ordinary menu event, this is for when the ordinary menu is gone or unusable.  I have grouped everything I used for the right click menu by a ;comment at the top and bottom to make it easy to figure out what was used.
;If you copy any part of this script please give due credit. Just a line above my code like ;"The following code was written by Typo @ http://www.hawkee.com/profile/44923" or something like that would be great.
;
;Usage: Type /ViewPic followed by a file name or /ViewPic alone for a file selection dialog or right cick in any window and select "Open picture" from the "Typos ViewPic" menu.
On *:Load:{ 
  if ($version < 6.3) { 
    noop $input(Sorry but this script requires mIRC 6.3 or higher to run.,o,ERROR 
    unload -rs $script
    return
  }
  if (!%ViewPicSaveDL) { set %ViewPicSaveDL no }
  if (!%ViewPicSavePath) { set %ViewPicSavePath $MircDir $+ ViewPic\ }
  if (!%ViewPicTimeout) { set %ViewPicTimeout 2 }
  if (!%ViewPicAlbumPath) { set %ViewPicAlbumPath $MircDir $+ ViewPic\ }
  if (!%ViewPicSlideShowDelay) { set %ViewPicSlideShowDelay 4 }
  mkdir " $+ $MircDir $+ ViewPic\ $+ "
  dialog $iif($Dialog(ViewPic),-ev,-md) ViewPic ViewPic 
}
alias ViewPic {
  if (!$1-) { 
    var %ViewPicFile $$sfile(%ViewPicLastPath $+ *.bmp,Select a picture.,OK) 
    set %ViewPicLastPath $nofile($qt(%ViewPicFile))
  }
  else { var %ViewPicFile $1- }
  if ($exists($qt(%ViewPicFile))) {  $iif($right(%ViewPicFile,4) == .gif,ViewPicAG,ViewPicAll) %ViewPicFile }
}
alias ViewPicAll {
  if (%ViewPicFailedLoad > 1) { ViewPicUnsetRunning }
  if (!%ViewPicInProgress) {
    set %ViewPicInProgress yes
    unset %ViewPicFailedLoad
    if ($gettok($1-,$0,32) == Downloaded) {
      var %ViewPicDownloaded = yes
      tokenize 32 $gettok($1-,1- $+ $calc($0 -1),32)    
    }
    if (!$1) {
      set %ViewPicFile $$sfile(%ViewPicLastPath $+ *.bmp,Select a picture.,OK) 
      set %ViewPicLastPath $nofile($qt(%ViewPicFile))
    }
    else { set %ViewPicFile $1- }
    if ($exists($qt(%ViewPicFile))) {
      if ($regex($right(%ViewPicFile,4),/\.?jpeg|jpg|gif|png|bmp/i)) && ($pic($qt(%ViewPicFile)).size) {
        set %ViewPicMode NormalScreen
        set %ViewPicTitle @ $+ $iif(%ViewPicDownloaded,$+($chr(164),Downloaded,$chr(164),$chr(160))) $+ Typos $+ $chr(160) $+ ViewPic
        var %ViewPicSW $window(-1).w, %ViewPicSH $window(-1).h, %ViewPicPW $pic($qt(%ViewPicFile)).width, %ViewPicPH $pic($qt(%ViewPicFile)).height, %ViewPicNW $round($calc($window(-1).w * .90),0), %ViewPicNH $round($calc($window(-1).h * .90),0), %ViewPicAspect $iif($pic($qt(%ViewPicFile)).width > $pic($qt(%ViewPicFile)).height,$v1 / $v2,$v2 / $v1)
        set %ViewPicWidth $round($iif(%ViewPicPW !> %ViewPicNW && %ViewPicPH !> %ViewPicNH,%ViewPicPW,$iif(%ViewPicPW > %ViewPicPH,$iif(%ViewPicPW > %ViewPicNW,%ViewPicNW,%ViewPicPW),$iif(%ViewPicPH > %ViewPicNH,$calc(%ViewPicNH / %ViewPicAspect),$calc(%ViewPicPH / %ViewPicAspect)))),0)
        set %ViewPicHeight $round($iif(%ViewPicPH !> %ViewPicNH && %ViewPicPW !> %ViewPicNW,%ViewPicPH,$iif(%ViewPicPH > %ViewPicPW,$iif(%ViewPicPH > %ViewPicNH,%ViewPicNH,%ViewPicPH),$iif(%ViewPicPW > %ViewPicNW,$calc(%ViewPicNW / %ViewPicAspect),$calc(%ViewPicPW / %ViewPicAspect)))),0)
        set %ViewPicSetWidth $round($iif(%ViewPicPW !> %ViewPicNW && %ViewPicPH !> %ViewPicNH,%ViewPicPW,$iif(%ViewPicPW > %ViewPicPH,$iif(%ViewPicPW > %ViewPicNW,%ViewPicNW,%ViewPicPW),$iif(%ViewPicPH > %ViewPicNH,$calc(%ViewPicNH / %ViewPicAspect),$calc(%ViewPicPH / %ViewPicAspect)))),0)
        set %ViewPicSetHeight $round($iif(%ViewPicPH !> %ViewPicNH && %ViewPicPW !> %ViewPicNW,%ViewPicPH,$iif(%ViewPicPH > %ViewPicPW,$iif(%ViewPicPH > %ViewPicNH,%ViewPicNH,%ViewPicPH),$iif(%ViewPicPW > %ViewPicNW,$calc(%ViewPicNW / %ViewPicAspect),$calc(%ViewPicPW / %ViewPicAspect)))),0)
        write -c ViewPicMenuFile.tmp <[Typos ViewPic Control Panel]>:dialog $!iif($Dialog(ViewPic),-evo,-mdo) ViewPic ViewPic
        write ViewPicMenuFile.tmp <[Switch to $!iif(%ViewPicMode == fullscreen,normal,$iif( $!window(%ViewPicTitle).dw != $!(%ViewPicSetWidth) || $!window(%ViewPicTitle).dh != $!(%ViewPicSetHeight),normal,fullscreen)) mode.]>:ViewPicModes %ViewPictitle
        write ViewPicMenuFile.tmp <[Save the current picture as...]>:ViewPicSaveAs $!(%ViewPicFile)
        write ViewPicMenuFile.tmp <[View the next picture]>:ViewPicScroll($!active).F
        write ViewPicMenuFile.tmp <[View the previous picture]>:ViewPicScroll($!active).B
        write ViewPicMenuFile.tmp <[Start a slideshow]>:viewpicslideshow $!active
        window -afdpk0Cow0 +l %ViewPicTitle -1 -1  %ViewPicWidth %ViewPicHeight ViewPicMenuFile.tmp mirc.exe 18
        titlebar %ViewPicTitle $nopath(%ViewPicFile)
        drawpic -ms %ViewPicTitle 0 0 %ViewPicWidth %ViewPicHeight 0 0 %ViewPicPW %ViewPicPH $qt(%ViewPicFile)
        .timerViewPicResize -m 0 10 if ( $!window(%ViewPicTitle) ) && ( $!window(%ViewPicTitle).dw != $!(%viewpicwidth) ) || ( $!window(%ViewPicTitle).dh != $!(%viewpicheight) ) if ( $!(%ViewPicMode) == NormalScreen) drawpic -ms $!(%ViewPicTitle) 0 0 $!window(%ViewPicTitle).dw $!window(%ViewPicTitle).dh 0 0 $!pic($qt(%ViewPicfile)).width $!pic($qt(%ViewPicFile)).height $!qt(%ViewPicFile) $chr(124) if ( $!window(%ViewPicTitle).dw != $!(%viewpicwidth) ) set %ViewPicWidth $!window(%ViewPicTitle).dw $chr(124) if ( $!window(%ViewPicTitle).dh != $!(%viewpicheight) ) set %ViewPicHeight $!window(%ViewPicTitle).dh
      }
      else {
        noop $input(That does not appear to be a supported image type.  /ViewPic supports .JPEG $+ $chr(44) .JPG $+ $chr(44) .BMP $+ $chr(44) .GIF and .PNG  Type /ViewPic Drive:\Path\To\File.ext to load a picture or type /ViewPic alone to use the file selection dialog.,o,Error!) 
        if (%viewpicscrolling) { $($!viewpicscroll($gettok(%viewpicscrolling,2-,32)). $+ $iif($gettok(%viewpicscrolling,1,32) == Forward,F),2) }
        else { ViewPicUnsetRunning }
      }
    }
    else {
      noop $input(Invalid Filename.  Type /ViewPic Drive:\Path\To\File.ext to load a picture or type /ViewPic alone to use the file selection dialog.,o,Error!) 
      if (%viewpicscrolling) { $($!viewpicscroll($gettok(%viewpicscrolling,2-,32)). $+ $iif($gettok(%viewpicscrolling,1,32) == Forward,F),2) }
      else { ViewPicUnsetRunning }
    }
  }
  else {
    noop $input(Typos ViewPic is already in use.  Please try again in a second or two. If this error comes up twice in a row the script will reset itself incase an error is preventing it from running.,o,Error!) 
    inc %ViewPicFailedLoad 1
  }
} 
alias ViewPicModes {
  var %ViewPicSW $window(-1).w, %ViewPicSH $window(-1).h, %ViewPicPW $pic($qt(%ViewPicFile)).width, %ViewPicPH $pic($qt(%ViewPicFile)).height, %ViewPicNW $round($calc($window(-1).w * .90),0), %ViewPicNH $round($calc($window(-1).h * .90),0), %ViewPicAspect $iif($pic($qt(%ViewPicFile)).width > $pic($qt(%ViewPicFile)).height,$v1 / $v2,$v2 / $v1), %ViewPicScreenAspect $iif($window(-1).w > $window(-1).h,$v1 / $v2,$v2 / $v1)
  var %ViewPicNSWidth $round($iif(%ViewPicPW !> %ViewPicNW && %ViewPicPH !> %ViewPicNH,%ViewPicPW,$iif(%ViewPicPW > %ViewPicPH,$iif(%ViewPicPW > %ViewPicNW,%ViewPicNW,%ViewPicPW),$iif(%ViewPicPH > %ViewPicNH,$calc(%ViewPicNH / %ViewPicAspect),$calc(%ViewPicPH / %ViewPicAspect)))),0)
  var %ViewPicNSHeight $round($iif(%ViewPicPH !> %ViewPicNH && %ViewPicPW !> %ViewPicNW,%ViewPicPH,$iif(%ViewPicPH > %ViewPicPW,$iif(%ViewPicPH > %ViewPicNH,%ViewPicNH,%ViewPicPH),$iif(%ViewPicPW > %ViewPicNW,$calc(%ViewPicNW / %ViewPicAspect),$calc(%ViewPicPW / %ViewPicAspect)))),0)
  if (zoom !isin %viewpicmode) { set %ViewPicMode $iif(%ViewPicMode == NormalScreen,$iif($window($1).dw != %ViewPicNSWidth || $window($1).dh != %ViewPicNSHeight,NormalScreen,FullScreen),NormalScreen) }
  var %ViewPicFSWidth $round($iif(%ViewPicAspect == %ViewPicScreenAspect && %ViewPicPW == %ViewPicSW,%ViewPicSW,$iif(%ViewPicAspect == 1,$iif(%ViewPicSW > %ViewPicSH,$v2,$v1),$iif(%ViewPicPW > %ViewPicPH,%ViewPicSW,$calc(%ViewPicSH / %ViewPicAspect)))),0)
  var %ViewPicFSHeight $round($iif(%ViewPicAspect == %ViewPicScreenAspect && %ViewPicPH == %ViewPicSH,%ViewPicSH,$iif(%ViewPicAspect == 1,$iif(%ViewPicSH > %ViewPicSW,$v2,$v1),$iif(%ViewPicPH > %ViewPicPW,%ViewPicSH,$calc(%ViewPicSW / %ViewPicAspect)))),0)
  window -c $1
  window -afdpk0Cow0 +l $+ $iif(%ViewPicMode == FullScreen,f) $1 -1 -1 $iif(%ViewPicMode == FullScreen,%ViewPicSW %ViewPicSH,%ViewPicNSWidth %ViewPicNSHeight) ViewPicMenuFile.tmp mirc.exe 18
  titlebar %ViewPicTitle $nopath(%ViewPicFile)
  drawfill $1 1 1 0 0 
  drawpic -ms $1 $iif(%viewpiczoom,$v1,$iif(%ViewPicPW == %ViewPicSW && %ViewPicPH == %ViewPicSH || %ViewPicMode == NormalScreen,1 1,$iif(%ViewPicAspect == 1 && %ViewPicSW > %ViewPicSH || %ViewPicPW < %ViewPicPH,$calc((%ViewPicSW * .5) - (%ViewPicFSWidth * .5)) 1,1 $calc((%ViewPicSH * .5) - (%ViewPicFSHeight * .5))))) $iif(Zoom isin %ViewPicMode,$calc(%ViewPicNSWidth * $iif(%viewpicmode == zoom,1.5,$iif($v1 == zoom2,2,2.5))) $calc(%ViewPicNSHeight * $iif(%viewpicmode == zoom,1.5,$iif($v1 == zoom2,2,2.5))),$iif(%ViewPicMode == NormalScreen,%ViewPicNSWidth %ViewPicNSHeight,%ViewPicFSWidth %ViewPicFSHeight)) 1 1 %ViewPicPW %ViewPicPH $qt(%ViewPicFile)
  unset %viewpiczoom
}
alias ViewPicAG {
  if (%ViewPicFailedLoad > 1) { ViewPicUnsetRunning }
  if (!%ViewPicInProgress) {
    unset %ViewPicFailedLoad
    set %ViewPicInProgress yes
    if ($gettok($1-,$0,32) == Downloaded) {
      var %ViewPicDownloaded = yes
      tokenize 32 $gettok($1-,1- $+ $calc($0 - 1),32)    
    }
    if (!$1) { 
      set %ViewPicFile $$sfile(%ViewPicLastPath $+ *.gif,Select a picture.,OK) 
      set %ViewPicLastPath $nofile($qt(%ViewPicFile))
    }
    else { set %ViewPicFile $1- }
    if ($exists($qt(%ViewPicFile))) && ($right(%ViewPicFile,4) == .gif) {
      if ($pic($qt(%ViewPicFile)).size) {
        write -c ViewPicMenuFile.tmp <[Typos ViewPic Control Panel]>:dialog $!iif($Dialog(ViewPic),-evo,-mdo) ViewPic ViewPic
        write ViewPicMenuFile.tmp <[Save the current picture as...]>:ViewPicSaveAs $qt(%ViewPicFile)
        write ViewPicMenuFile.tmp <[View the next picture]>:ViewPicScroll($!active).F
        write ViewPicMenuFile.tmp <[View the previous picture]>:ViewPicScroll($!active).B
        write ViewPicMenuFile.tmp <[Start a slideshow]>:viewpicslideshow $!active
        bread $qt(%ViewPicFile) 0 $file($qt(%ViewPicFile)).size &AniGif 
        var %AniGifSepPos $bfind(&AniGif, 0, 33 249 4), %AniGifDisposal $bvar(&AniGif,$calc(%AniGifSepPos + 3),1), %AniGifNamePre $left(%ViewPicFile,-4), %AniGifName $nopath(%AniGifNamepre), %AniGifDelayChars $bvar(&AniGif,$calc(%AniGifSepPos + 4),2)
        var %AniGifDelay $iif($calc($base($base($gettok(%AniGifDelayChars,2,32),10,16) $+ $base($gettok(%AniGifDelayChars,1,32),10,16),16,10) * 10) > 0,$v1,60), %AniGiflets 0
        if (!$bfind(&AniGif, $calc(%AniGifSepPos + 1), 33 249 4)) && (%AniGifSepPos != 0) || (%AniGifSepPos == 0) { 
          if ($isalias(ViewPicAll)) {
            unset %viewpicinprogress
            ViewPicAll %ViewPicFile $iif(%ViewPicDownloaded,Downloaded) 
          } 
          else { ViewPicAG2 %ViewPicFile $iif(%ViewPicDownloaded,Downloaded) }
          return  
        }
        if (%AniGifSepPos == 0) || (%AniGifDisposal == 5) || (%AniGifDisposal == 4) { 
          noop $input(This type of animated gif cannot be displayed due to limitations in mircs /drawpic command.  The first frame is being shown as a subsitute.,o,Error!) 
          if ($isalias(ViewPicAll)) { 
            unset %viewpicinprogress
            if (%viewpicscrolling) { $($!viewpicscroll($gettok(%viewpicscrolling,2-,32)). $+ $iif($gettok(%viewpicscrolling,1,32) == Forward,F),2) }
            else { ViewPicAll %ViewPicFile $iif(%ViewPicDownloaded,Downloaded) }
          } 
          elseif (%viewpicscrolling) { $($!viewpicscroll($gettok(%viewpicscrolling,2-,32)). $+ $iif($gettok(%viewpicscrolling,1,32) == Forward,F),2) }
          else { ViewPicAG2 %ViewPicFile $iif(%ViewPicDownloaded,Downloaded) }
          return
        }
        bwrite ViewPicGifHeader.tmp 0 $calc(%AniGifSepPos + 7) &AniGif
        while ($bfind(&AniGif, %AniGifSepPos, 33 249 4)) {
          var %AniGifSepPos $calc($v1 + 7), %AniGifSepPos [ $+ [ %AniGiflets ] ] $v1
          inc %AniGiflets
        }
        var %AniGifSepPos $+ %AniGiflets $file($qt(%ViewPicFile)).size, %AniGifFrames %AniGiflets, %AniGifSeg = 1
        while (%AniGifFrames > %AniGifSeg) {
          var %AniGifV1 %AniGifSepPos [ $+ [ %AniGifSeg ] ], %AniGifV2 %AniGifSepPos [ $+ [ $calc(%AniGifSeg + 1) ] ]
          bread $qt(%ViewPicFile) $calc(%AniGifV1 + 7) $calc(%AniGifV2 - (%AniGifV1 + 7)) &AniGiflet [ $+ [ %AniGifSeg ] ]
          bset &AniGiflet [ $+ [ %AniGifSeg ] ] $bvar(&AniGiflet [ $+ [ %AniGifSeg ] ],0) 59
          inc %AniGifSeg
        }
        var %AniGifFile 1
        while (%AniGiflets > %AniGifFile) {
          .copy -o ViewPicGifHeader.tmp $qt($+(%AniGifName,-Frame,%AniGifFile,.gif))
          bwrite $+(%AniGifName,-Frame,%AniGifFile,.gif) -1 -1 &AniGiflet [ $+ [ %AniGifFile ] ]
          inc %AniGifFile         
        }
        if ($exists(ViewPicGifHeader.tmp)) { .remove ViewPicGifHeader.tmp }
        set %ViewPicInProgress yes
        .timerViewPic -hm 0 %AniGifDelay ViewPicAG2 $+(%ViewPicFile,$chr(160),$calc(%AniGiflets - 1),$chr(160)) $iif(%ViewPicDownloaded,Downloaded)
      }
      else { 
        noop $input(That does not appear to be a supported GIF format or the file is corrupt. /ViewPicAG only supports GIF's. Type /ViewPicAG Drive:\Path\To\File.ext to load a picture or type /ViewPicAG alone to use the file selection dialog.,o,Error!) 
        if (%viewpicscrolling) { $($!viewpicscroll($gettok(%viewpicscrolling,2-,32)). $+ $iif($gettok(%viewpicscrolling,1,32) == Forward,F),2) }
        else { ViewPicUnsetRunning }
      }
    }
    else {
      noop $input(Invalid Filename.  Type /ViewPicAG Drive:\Path\To\File.ext to load a picture or type /ViewPicAG alone to use the file selection dialog.,o,Error!) 
      if (%viewpicscrolling) { $($!viewpicscroll($gettok(%viewpicscrolling,2-,32)). $+ $iif($gettok(%viewpicscrolling,1,32) == Forward,F),2) }
      else { ViewPicUnsetRunning }
    }
  }
  else {
    noop $input(Typos ViewPic is already in use.  Please try again in a second or two. If this error comes up twice in a row the script will reset itself incase an error is preventing it from running.,o,Error!) 
    inc %ViewPicFailedLoad 1
  }
}
alias ViewPicAG2 {
  if (!%AniGifCurrent) { set %AniGifCurrent 1 }
  var %AniGifFile $gettok($1-,1,160), %AniGifFrames $gettok($1-,2,160), %AniGifSW $window(-1).w, %AniGifSH $window(-1).h, %AniGifPW $pic($qt(%AniGifFile)).width, %AniGifPH $pic($qt(%AniGifFile)).height, %AniGifNW $round($calc($window(-1).w * .90),0), %AniGifNH $round($calc($window(-1).h * .90),0), %AniGifAspect $iif($pic($qt(%AniGifFile)).width > $pic($qt(%AniGifFile)).height,$v1 / $v2,$v2 / $v1)
  var %ViewPicTitle @ $+ $iif(($gettok($1-,$0,32) == Downloaded),$+($chr(164),Downloaded,$chr(164),$chr(160))) $+ Typos $+ $chr(160) $+ ViewPic, %FramesNames $left(%AniGifFile,-4) $+ -Frame $+ %AniGifCurrent $+ $right(%AniGifFile,4)
  var %AniGifWidth $round($iif(%AniGifPW !> %AniGifNW && %AniGifPH !> %AniGifNH,%AniGifPW,$iif(%AniGifPW > %AniGifPH,$iif(%AniGifPW > %AniGifNW,%AniGifNW,%AniGifPW),$iif(%AniGifPH > %AniGifNH,$calc(%AniGifNH / %AniGifAspect),$calc(%AniGifPH / %AniGifAspect)))),0)
  var %AniGifHeight $round($iif(%AniGifPH !> %AniGifNH && %AniGifPW !> %AniGifNW,%AniGifPH,$iif(%AniGifPH > %AniGifPW,$iif(%AniGifPH > %AniGifNH,%AniGifNH,%AniGifPH),$iif(%AniGifPW > %AniGifNW,$calc(%AniGifNW / %AniGifAspect),$calc(%AniGifPW / %AniGifAspect)))),0)
  if (!$window(%ViewPicTitle)) { window -afdpk0Cow0 +lt %ViewPicTitle  -1 -1 %AniGifWidth %AniGifHeight ViewPicMenuFile.tmp mirc.exe 18 }
  drawpic -cms %ViewPicTitle 1 1 %AniGifWidth %AniGifHeight 1 1 %AniGifPW %AniGifPH $qt($iif(!%AniGifFrames,%AniGifFile,$gettok(%FramesNames,$numtok(%FramesNames,92),92)))
  titlebar %ViewPicTitle $nopath(%ViewPicFile)
  if (%AniGifFrames > %AniGifCurrent) { inc %AniGifCurrent }
  else { set %AniGifCurrent 1 }
}
alias viewpicslideshow {
  $viewpicscroll(Typos $+ $chr(160) $+ ViewPic).F
  .timerviewpicslideshow 0 %viewpicslideshowdelay $!viewpicscroll(Typos $+ $chr(160) $+ ViewPic).F
}
alias ViewPicScroll {
  if ($window(@ViewPicScroll)) { window -c $v1 }
  window -hw0 @ViewPicScroll
  noop $findfile($nofile($qt($iif(%viewpicfile,$v1,%ViewPicSavePath))),*.jpg;*.bmp;*.png;*.gif;*.jpeg,0,1,aline @ViewPicScroll $nopath($1-))
  filter -uwwct 0 32 @ViewPicScroll @ViewPicScroll *
  if ($window(@Typos $+ $chr(160) $+ ViewPic)) { window -c $v1 }
  elseif ($window($+(@,$chr(164),Downloaded,$chr(164),$chr(160),Typos,$chr(160),ViewPic))) { window -c $v1 }
  var %viewpicfiletmp %ViewPicFile
  viewpicclosing $1 reopen
  if ($window(@Typos $+ $chr(160) $+ ViewPic)) { window -c $v1 }
  if ($window($+(@,$chr(164),Downloaded,$chr(164),$chr(160),Typos,$chr(160),ViewPic))) { window -c $v1 }
  set %ViewPicScrolling $iif($prop == f,Forward,Backward) $1-
  ViewPic $nofile($iif(%viewpicfiletmp,$v1,%viewpicsavepath)) $+ $line(@ViewPicScroll,$iif(!$nopath(%viewpicfiletmp) || $calc($fline(@ViewPicScroll,$nopath(%ViewPicFiletmp)) $iif($prop == F,+,-) 1) > $line(@ViewPicScroll,0),1,$iif($v1 <= 0,$line(@ViewPicScroll,0),$v1))))
  window -c @ViewPicScroll 
}
on *:keydown:*:*:{ 
  if (*Typos $+ $chr(160) $+ ViewPic* iswm $target) {
    if ($timer(viewpicslideshow)) {
      .timerviewpicslideshow off
      return
    }
    if ($keyval == 33) || ($keyval == 37) || ($keyval == 189) { $ViewPicScroll($active).B }
    elseif ($keyval == 34) || ($keyval == 39) || ($keyval == 187) { $ViewPicScroll($active).F }
    elseif (!$timer(TyposViewPic)) && (%ViewPicMode) {
      if (zoom isin %viewpicmode) { set %viewpicmode %normalscreen }
      ViewPicModes $target 
    } 
  } 
}
on *:open:@:{ if (*Typos $+ $chr(160) $+ ViewPic* iswm $target) { .timerViewPicTimeOut off } }
on *:close:@:{ viewpicclosing $target }
alias viewpicclosing {
  if (*Typos $+ $chr(160) $+ ViewPic* iswm $1-) {
    if ($timer(viewpicslideshow).com) { var %viewpicslidetmp $v1 }
    .timerViewPic* off
    if ($2) && (%viewpicslidetmp) { .timerviewpicslideshow 0 %viewpicslideshowdelay $v1 }
    var %CurrentDelete = 1
    if ($exists(ViewPicDLFile.tmp)) { .remove ViewPicDLFile.tmp }
    if ($exists(ViewPicMenuFile.tmp)) { .remove ViewPicMenuFile.tmp }
    if (* $+ $chr(164) $+ Downloaded $+ $chr(164) $+ * iswm $target) && ($exists($qt(%ViewPicFile))) { .remove $qt(%ViewPicFile) }
    while ($exists($qt($left($nopath(%ViewPicFile),-4) $+ -Frame $+ %CurrentDelete $+ $right(%ViewPicFile,4)))) {
      .remove $qt($left($nopath(%ViewPicFile),-4) $+ -Frame $+ %CurrentDelete $+ $right(%ViewPicFile,4))
      inc %CurrentDelete
    }
    unset %ViewPicFile %ViewPicIncoming* %ViewPicInProgress %ViewPicWebURL %AniGifCurrent %ViewPicMode %ViewPicTitle %ViewPicWidth %ViewPicHeight %ViewPicSetWidth %ViewPicSetHeight
  }
}
alias ViewPicDownloader {
  if (%ViewPicFailedLoad > 1) { ViewPicUnsetRunning }
  if (!%ViewPicInProgress) {
    unset %ViewPicFailedLoad
    set %ViewPicInProgress yes
    if ($left($1,4) == http) { set %ViewPicWebURL $right($1,- $+ $calc($pos($1,://,1) + 2)) }
    else { set %ViewPicWebURL $1 }
    if ($exists($nopath(%ViewPicWebURL))) { 
      if ($exists(OldCopyOf $+ $nopath(%ViewPicWebURL))) { .remove $nopath(%ViewPicWebURL) }
      else { .rename $nopath(%ViewPicWebURL) OldCopyOf $+ $nopath(%ViewPicWebURL) }
    }
    if ($exists(ViewPicDLFile.tmp)) { .remove ViewPicDLFile.tmp }
    if (!$window(@ViewPicProgress)) { window -fdpk0Cow0 +fl @ViewPicProgress -1 -1 100 10 }
    drawtext @ViewPicProgress 4 Verdana 10 49 -1 0%
    sockopen ViewPic $gettok(%ViewPicWebURL,1,47) 80
  }
  else {
    noop $input(Typos ViewPic is already in use.  Please try again in a second or two. If this error comes up twice in a row the script will reset itself incase an error is preventing it from running.,o,Error!) 
    inc %ViewPicFailedLoad 1
  }
}
on *:sockopen:ViewPic:{
  if (!$sockerr) {
    sockwrite -nt $sockname GET / $+ $gettok(%ViewPicWebURL,2-,47) HTTP/1.0
    sockwrite -nt $sockname Host: $gettok(%ViewPicWebURL,1,47)
    sockwrite -n $sockname Cookie: PHPSESSID="";Path="" 
    sockwrite -n $sockname Accept-Ranges: bytes
    sockwrite -n $sockname Accept: */* 
    sockwrite -n $sockname Connection: close 
    sockwrite -n $sockname $crlf
    unset %viewpicsockseconds
    unset %viewpicsockrcvd
    .timerViewPicTimeOut -m 0 2000 ViewPicTimeOut $Ticks $!Ticks $!sock(ViewPic).rcvd
  }
  else { 
    ViewPicUnsetRunning
    .timer 1 0 noop $!input(Nothing to view! HTTP error!,o,Error!)
  }
}
on *:sockread:ViewPic:{
  if (%ViewPicIncomingCount >= 2) {
    var %ViewPicPercentDL $iif($iif($calc($sock($sockname).rcvd - %ViewPicProgressStartBytes) == %ViewPicDLSize,100,$left($gettok($calc(($sock($sockname).rcvd - %ViewPicProgressStartBytes) / %ViewPicDLSize),2,46),2)) == $null,0,$v1)
    sockread -f &ViewPicIncoming
    if ($sockbr == 0) { return }
    if (!$window(@ViewPicProgress)) { window -fdpk0Cow0 +fl @ViewPicProgress -1 -1 100 10 }
    drawrect -f @ViewPicProgress 0 0 %ViewPicPercentDL 0 $calc(100 - %ViewPicPercentDL) 10
    drawrect -f @ViewPicProgress 12 12 0 0 %ViewPicPercentDL 10
    drawtext @ViewPicProgress 4 Verdana 10 %ViewPicPercentDL -1 %ViewPicPercentDL $+ %
    bwrite ViewPicDLFile.tmp -1 -1 &ViewPicIncoming
  }
  else {
    sockread %ViewPicIncoming
    if ($sockbr == 0) { return }
    if (Content-Length: isin %ViewPicIncoming) { set  %ViewPicDLSize $gettok(%ViewPicIncoming,2,32) }
    if (*404 Not Found* iswm %ViewPicIncoming) || (*403 Forbidden* iswm %ViewPicIncoming) {
      .timer 1 0 noop $!input(Nothing to view! HTTP 403/404 error!,o,Error!)
      sockclose $sockname
      unset %ViewPicIncoming* %ViewPicInProgress  %ViewPicWebURL
      return
    }
    if (!%ViewPicIncoming) && (%ViewPicIncomingCount == 1) { 
      set %ViewPicProgressStartBytes $sock($sockname).rcvd
      inc %ViewPicIncomingCount 
    } 
    if (Content-Length: isin %ViewPicIncoming) { inc %ViewPicIncomingCount }
  } 
}
on *:sockclose:ViewPic:{ 
  if ($window(@ViewPicProgress)) { window -c $v1 }
  .timerviewpictimeout off
  if ($exists(ViewPicDLFile.tmp)) && (%ViewPicWebURL) {
    var %OriginalName $nopath(%ViewPicWebURL)
    if (%viewpicsavedl == yes) { .copy -o ViewPicDLFile.tmp $qt(%ViewPicSavePath $+ %OriginalName) }
    .rename ViewPicDLFile.tmp $qt(%OriginalName)
    if (!$pic($qt(%OriginalName)).size) {
      .timer 1 0 noop $!input(Nothing to view! Download error!,o,Error!)
      ViewPicUnsetRunning 
    }
    else {
      .timerViewPicSockClose 1 0 $iif($right(%OriginalName,4) == .gif,ViewPicAG,ViewPicAll) $mircdir $+ %OriginalName Downloaded
      unset %viewpicincoming* %viewpicdlsize %viewpicprogressstartbytes %viewpicpercentdl %ViewPicInProgress
    }
  }
  else { 
    .timer 1 0 noop $!input(Nothing to view! Download error!,o,Error!)
    ViewPicUnsetRunning 
  }
  unset %viewpicincoming* %viewpicdlsize %viewpicprogressstartbytes %viewpicpercentdl %viewpicsockrcvd %viewpicsockseconds
}
alias ViewPicTimeOut {
  if ($window(@ViewPicProgress)) {
    if (%ViewPicSockSeconds) {
      if ($calc($3 - $gettok(%ViewPicSockRcvd,1,32)) <= 300) || ($calc($2 - $1) >= $calc(%ViewPicTimeout * 60 * 1000)) {
        ViewPicUnsetRunning
        noop $input(The Download has timed out.,o,Error!)
      }
    }
    inc %ViewPicSockSeconds
    set %ViewPicSockRcvd $sock(ViewPic).Rcvd $ticks
  }
  else { 
    unset %ViewPicSockRcvd
    unset %viewpicsockseconds
    .timerViewPicTimeOut off 
  }
}
alias ViewPicUnsetRunning {
  unset %ViewPicFile %ViewPicTitle %ViewPicWidth %ViewPicHeight %ViewPicInProgress %ViewPicMode %ViewPicWebURL %viewpicincoming* %viewpicdlsize %viewpicprogressstartbytes %viewpicpercentdl %AniGif* %ViewPicSetWidth %ViewPicSetHeight %ViewPicSockRcvd %viewpicsockseconds
  .timerViewPic* off
  if ($sock(ViewPic)) { sockclose $v1 }
  if ($window(@Typos $+ $chr(160) $+ ViewPic)) { window -c $v1 }
  if ($window($+(@,$chr(164),Downloaded,$chr(164),$chr(160),Typos,$chr(160),ViewPic))) { window -c $v1 }
  if ($window(@ViewPicRightClick)) { window -c $v1 }
  if ($window(@ViewPicProgress)) { window -c $v1 }
  if ($exists(ViewPicDLFile.tmp)) { .remove ViewPicDLFile.tmp }
  if ($exists(ViewPicMenuFile.tmp)) { .remove ViewPicMenuFile.tmp }
  if ($exists(ViewPicGifHeader.tmp)) { .remove ViewPicGifHeader.tmp }
}
alias ViewPicSaveAs {
  var %ViewPicSaveAsFolder $sdir(%viewpicsavepath,Select the folder to save the new copy to.), %ViewPicSaveAsName $input(Select a name for the new copy.  You do not need to include a file extension or path $+ $chr(44) $+ just a name.,e,Ok), %ViewPicSaveAs $+(",%ViewPicSaveAsFolder,%ViewPicSaveAsName,.,$gettok($1-,$numtok($1-,46),46),")
  if ($exists(%ViewPicSaveAs)) { noop $input(Sorry but that file already exists.  Please try again.,o,Error!) }
  elseif (%ViewPicSaveAsName) { copy $1- %ViewPicSaveAs }
}
dialog ViewPic {
  title "Typos ViewPic"
  size -1 -1 82 146
  option dbu
  box "", 1, 2 19 78 15
  check "Save Downloaded Photos.", 2, 5 23 73 10
  button "Done", 3, 26 132 30 10, default ok cancel
  box "", 6, 2 0 78 20
  button "Change Folder.", 7, 21 40 41 10
  box "", 8, 2 33 78 32
  edit "", 10, 3 52 76 10, read autohs
  box "", 11, 0 -3 82 149
  text "Select Whether or not to save the downloaded pictures.", 4, 4 4 74 14, center
  box "", 12, 2 96 78 33
  text "Set the download timeout in minutes.", 13, 4 101 74 14, center
  combo 14, 29 116 24 10, drop
  box "", 15, 2 64 78 33
  text "Set the time between pictures in seconds for the slideshow.", 16, 4 69 74 14, center
  combo 17, 29 84 24 10, drop
}
On *:Dialog:ViewPic:init:0:{ 
  if (%ViewPicSaveDL == yes) { did -c ViewPic 2 }
  did -ra ViewPic 10 $iif(%ViewPicSavePath,$v1,No path selected) 
  var %tonums 1, %ssnum 1
  while (%ssnum < 16) {
    did -a ViewPic 17 %ssnum
    inc %ssnum
  }
  if (%ViewPicSlideShowDelay) { did -c ViewPic 17 %ViewPicSlideShowDelay } 
  else { did -c ViewPic 17 3 }
  while (%tonums < 11) {
    did -a ViewPic 14 %tonums
    inc %tonums 
  }
  if (%ViewPicTimeout) { did -c ViewPic 14 %ViewPicTimeout } 
  else { did -c ViewPic 14 2 }
}
On *:Dialog:ViewPic:SClick:*:{
  if ($did == 3) {
    set %ViewPicSaveDL $iif($did(2).state == 1,yes,no) 
    if {$did(14).sel != %ViewPicTimeout) { set %ViewPicTimeout $did(14).sel }
    if {$did(17).sel != %ViewPicSlideShowDelay) { set %ViewPicSlideShowDelay $did(17).sel }
  } 
  if ($did == 7) {
    var %tmpvpdir $sdir(*.* $+ $chr(44) $+ Select a directory for the downloaded photos.)
    if ($isdir(%tmpvpdir)) {
      set %ViewPicSavePath %tmpvpdir
    }
    did -ra ViewPic 10 $iif(%ViewPicSavePath,$v1,No path selected)
  }
}
dialog ViewPicAlbum {
  title "ViewPic Album"
  size -1 -1 175 285
  option dbu
  button "Done", 1, 77 271 21 10, default ok
  button "Last Page", 2, 4 231 31 10
  button "Next Page", 3, 139 231 31 10
  text "Use the 'Next page' and 'Last page' buttons to change the page and double click any photo to view it or single click to selected for deletion.", 4, 3 2 170 14, center
  box "", 5, 1 -2 173 20
  box "", 9, 134 53 36 39
  box "", 8, 91 53 36 39
  box "", 7, 48 53 36 39
  box "", 6, 5 53 36 39
  icon 24, 6 59 33 29
  icon 25, 49 59 33 29
  icon 26, 92 59 33 29
  icon 27, 135 59 33 29
  box "", 13, 134 97 36 39
  box "", 12, 91 97 36 39
  box "", 11, 48 97 36 39
  box "", 10, 5 97 36 39
  icon 28, 6 103 33 29
  icon 29, 49 103 33 29
  icon 30, 92 103 33 29
  icon 31, 135 103 33 29
  box "", 17, 134 141 36 39
  box "", 16, 91 141 36 39
  box "", 15, 48 141 36 39
  box "", 14, 5 141 36 39
  icon 32, 6 147 33 29
  icon 33, 49 147 33 29
  icon 34, 92 147 33 29
  icon 35, 135 147 33 29
  box "", 21, 134 185 36 39
  box "", 20, 91 185 36 39
  box "", 19, 48 185 36 39
  box "", 18, 5 185 36 39
  icon 36, 6 191 33 29
  icon 37, 49 191 33 29
  icon 38, 92 191 33 29
  icon 39, 135 191 33 29
  box "", 22, 1 49 173 179
  box "", 23, 0 -2 175 286
  box "", 41, 4 52 38 41
  box "", 42, 3 51 40 43
  box "", 43, 2 50 42 45
  box "", 44, 45 50 42 45
  box "", 45, 46 51 40 43
  box "", 46, 47 52 38 41
  box "", 47, 88 50 42 45
  box "", 48, 89 51 40 43
  box "", 49, 90 52 38 41
  box "", 50, 131 50 42 45
  box "", 51, 132 51 40 43
  box "", 52, 133 52 38 41
  box "", 64, 133 96 38 41
  box "", 63, 132 95 40 43
  box "", 62, 131 94 42 45
  box "", 61, 90 96 38 41
  box "", 60, 89 95 40 43
  box "", 59, 88 94 42 45
  box "", 58, 47 96 38 41
  box "", 57, 46 95 40 43
  box "", 56, 45 94 42 45
  box "", 55, 2 94 42 45
  box "", 54, 3 95 40 43
  box "", 53, 4 96 38 41
  box "", 76, 133 140 38 41
  box "", 75, 132 139 40 43
  box "", 74, 131 138 42 45
  box "", 73, 90 140 38 41
  box "", 72, 89 139 40 43
  box "", 71, 88 138 42 45
  box "", 70, 47 140 38 41
  box "", 69, 46 139 40 43
  box "", 68, 45 138 42 45
  box "", 67, 2 138 42 45
  box "", 66, 3 139 40 43
  box "", 65, 4 140 38 41
  box "", 88, 133 184 38 41
  box "", 87, 132 183 40 43
  box "", 86, 131 182 42 45
  box "", 85, 90 184 38 41
  box "", 84, 89 183 40 43
  box "", 83, 88 182 42 45
  box "", 82, 47 184 38 41
  box "", 81, 46 183 40 43
  box "", 80, 45 182 42 45
  box "", 79, 3 183 40 43
  box "", 78, 4 184 38 41
  box "", 77, 2 182 42 45
  button "Permanently Delete", 89, 60 257 55 10
  box "", 90, 1 241 173 28
  edit "Single click a picture to select it.", 92, 40 246 95 10, read autohs center
  button "Change the current folder", 93, 7 39 68 10
  box "", 94, 1 16 173 35
  edit "", 95, 7 27 160 10, read autohs center
  text "Currently viewing:", 96, 63 20 49 7, center
  box "", 97, 1 226 173 17
  button "Open the current folder", 98, 99 39 68 10
  button "Start a slideshow", 40, 64 231 47 10
}
on *:dialog:ViewPicAlbum:init:0:{ 
  unset %ViewPicAlbumPlace
  did -h viewpicalbum 6-21,41-88
  viewpicscrollalbum
  did -a viewpicalbum 95 %viewpicalbumpath
}
On *:dialog:ViewPicAlbum:dclick:24-39:{ viewpic $line(@viewpicscrollalbum,$calc((%ViewPicAlbumPlace - 16) + ($did - 24))) }
On *:dialog:ViewPicAlbum:sclick:0,2-3,24-40,89,93,98:{ 
  if ($did == 40) { viewpicslideshow }
  if ($did == 98) { run %viewpicalbumpath }
  if ($did == 89) && ($did(viewpicalbum,92) != Single click a picture to select it.) { 
    dialog -n viewpicalbum viewpicalbum
    if ($input(Are you sure you wish to delete $did(viewpicalbum,92),y,Delete file?)) {
      remove -b $qt(%viewpicalbumpath $+ $did(viewpicalbum,92))
      dialog -oev viewpicalbum viewpicalbum
      did -h viewpicalbum 6-21,41-88
      set %viewpicalbumplace $calc(%viewpicalbumplace - 16)
      did -ra viewpicalbum 92 Single click a picture to select it.
      viewpicscrollalbum
    }
    dialog -oev viewpicalbum viewpicalbum
  }
  if ($did == 93) {
    dialog -n viewpicalbum viewpicalbum
    if ($$sdir(%ViewPicSavePath)) { 
      set %ViewPicAlbumPath $v1
      set %ViewPicAlbumPlace 1
      did -h viewpicalbum 6-21,41-88
      did -r viewpicalbum 92,95
      did -a viewpicalbum 95 %ViewPicAlbumPath 
      viewpicscrollalbum
    }
    dialog -oev viewpicalbum viewpicalbum
  }
  if ($did isnum 2-3) { 
    did -h viewpicalbum 6-21,41-88
    viewpicscrollalbum $iif($did == 2,last) 
  } 
  if ($did == 0) || ($did isnum 24-39) {
    if ($inrect($mouse.x,$mouse.y,10,106,72,78)) { var %ViewPicSelected 6 }
    if ($inrect($mouse.x,$mouse.y,96,106,72,78)) { var %ViewPicSelected 7 }
    if ($inrect($mouse.x,$mouse.y,182,106,72,78)) { var %ViewPicSelected 8 }
    if ($inrect($mouse.x,$mouse.y,268,106,72,78)) { var %ViewPicSelected 9 }
    if ($inrect($mouse.x,$mouse.y,10,194,72,78)) { var %ViewPicSelected 10 }
    if ($inrect($mouse.x,$mouse.y,96,194,72,78)) { var %ViewPicSelected 11 }
    if ($inrect($mouse.x,$mouse.y,182,194,72,78)) { var %ViewPicSelected 12 }
    if ($inrect($mouse.x,$mouse.y,268,194,72,78)) { var %ViewPicSelected 13 }
    if ($inrect($mouse.x,$mouse.y,10,282,72,78)) { var %ViewPicSelected 14 }
    if ($inrect($mouse.x,$mouse.y,96,282,72,78)) { var %ViewPicSelected 15 }
    if ($inrect($mouse.x,$mouse.y,182,282,72,78)) { var %ViewPicSelected 16 }
    if ($inrect($mouse.x,$mouse.y,268,282,72,78)) { var %ViewPicSelected 17 }
    if ($inrect($mouse.x,$mouse.y,10,370,72,78)) { var %ViewPicSelected 18 }
    if ($inrect($mouse.x,$mouse.y,96,370,72,78)) { var %ViewPicSelected 19 }
    if ($inrect($mouse.x,$mouse.y,182,370,72,78)) { var %ViewPicSelected 20 }
    if ($inrect($mouse.x,$mouse.y,268,370,72,78)) { var %ViewPicSelected 21 }
    if (%ViewPicSelected)  {
      did -ra viewpicalbum 92 $nopath($line(@viewpicscrollalbum,$calc((%ViewPicAlbumPlace - 16) + (%ViewPicSelected - 6))))
      did -h viewpicalbum 6-21,41-88
      did -v viewpicalbum %ViewPicSelected $+ , $+ $calc(((%ViewPicSelected - 6) * 3) + 41) $+ - $+ $calc(((%ViewPicSelected - 6) * 3) + 43)
    }
  }
}
On Dialog:ViewPicAlbum:close:0:{
  if ($window(@ViewPicScrollAlbum)) { window -c $v1 }
  unset %viewpicalbumplace
}
alias ViewPicScrollAlbum {
  did -h viewpicalbum 24-39
  ViewPicFileList
  if ($line(@ViewPicScrollAlbum,0)) {
    var %ViewPicAlbumNum 1
    if ($1 == Last) { set %ViewPicAlbumPlace $iif($calc(%ViewPicAlbumPlace - 32) <= 0,$iif(16 // $line(@viewpicscrollalbum,0),$calc(($floor($calc($v2 / 16)) * 16) - 15),$calc(($floor($calc($v2 / 16)) * 16) + 1)),$calc(%ViewPicAlbumPlace - 32)) }
    if (!%ViewPicAlbumPlace) || (%ViewPicAlbumPlace > $line(@ViewPicScrollAlbum,0)) { set %ViewPicAlbumPlace 1 }
    while (%ViewPicAlbumNum < 17) {
      if (%ViewPicAlbumPlace <= $line(@ViewPicScrollAlbum,0)) && ($pic($line(@ViewPicScrollAlbum,%ViewPicAlbumPlace)).size) {
        did -g viewpicalbum $calc(%ViewPicAlbumNum + 23) $qt($line(@ViewPicScrollAlbum,%ViewPicAlbumPlace)) 
        var %viewpicalbumfilled $addtok(%viewpicalbumfilled,$calc(%ViewPicAlbumNum + 23),44)
      }
      inc %ViewPicAlbumNum
      inc %ViewPicAlbumPlace
    }
    did -v viewpicalbum %viewpicalbumfilled
  }
  else { 
    dialog -n viewpicalbum viewpicalbum
    noop $input(There are no pictures in the currently selected folder.,o,Nothing to view!) 
    dialog -oev viewpicalbum viewpicalbum
 
  }
}
alias ViewPicFileList {
  if ($window(@ViewPicScrollAlbum)) { window -c $v1 }
  window -hw0 @ViewPicScrollAlbum
  noop $findfile($qt(%ViewPicAlbumPath),*.jpg;*.bmp;*.png;*.gif;*.jpeg,0,1,aline @ViewPicScrollAlbum $1-)
  filter -uwwct 0 32 @ViewPicScrollAlbum @ViewPicScrollAlbum *
}
on $*:hotlink:/((?:https?://|www\d?\.).*\.(?:jpg|png|gif|bmp|jpeg)$)/i:*:{
  if ($mouse.key & 1) { ViewPicDownloader $regml(1) } 
  halt 
}
;Begin everything needed for the Right Click Menu.
on $^*:hotlink:/((?:https?://|www\d?\.).*\.(?:jpg|png|gif|bmp|jpeg)$)/i:*:{ 
  if ($mouse.key & 16) { 
    ViewPicRightClick $mouse.dx $mouse.dy
    set -e %ViewPicRightClickURL $regml(1)
  }
}
alias ViewPicRightClick {
  if ($2) {
    if ($window(@ViewPicRightClick)) { window -c @ViewPicRightClick }
    if (!$timer(ViewPicRightClick)) { .timerViewPicRightClick -oh 0 10 $!iif($mouse.win == @ViewPicRightClick,$iif($mouse.y isnum 0-13,ViewPicRightClickline 1,$iif($mouse.y isnum 20-33,ViewPicRightClickline 2,$iif($mouse.y isnum 40-53,ViewPicRightClickline 3)))) }
    window -dBpow0 +feL @ViewPicRightClick $1 $calc($2 - 31) 192 62
    drawfill -r @ViewPicRightClick 13882323 13882323 0 0 
    drawtext @ViewPicRightClick 1 Verdana 11 0 0 $str($chr(160),13) $+ Copy address
    drawline -r @ViewPicRightClick 8421504 1 2 17 184 17 
    drawline @ViewPicRightClick 0 1 2 18 184 18 
    drawtext @ViewPicRightClick 1 Verdana 11 0 20 $str($chr(160),2) $+ Open in new browser window
    drawline -r @ViewPicRightClick 8421504 1 2 37 184 37 
    drawline @ViewPicRightClick 0 1 2 38 184 38 
    drawtext @ViewPicRightClick 1 Verdana 11 0 40 $chr(160) $+ Open in active browser window
  }
}
Alias ViewPicRightClickLine {
  if ($1 isnum 1-3) {
    var %rclines = 1
    while (%rclines < 4) {
      drawreplace -r @ViewPicRightClick $iif(%rclines == $1,13882323 7346457,7346457 13882323) 0 $iif(%rclines == 1,1,$iif(%rclines == 2,21,$iif(%rclines == 3,41))) 192 13
      drawreplace @ViewPicRightClick $iif(%rclines == $1,1 0,0 1) 0 $iif(%rclines == 1,1,$iif(%rclines == 2,22,$iif(%rclines == 3,41))) 192 13
      inc %rclines
    }
  }
}
alias ViewPicRightClickDone {
  .timerViewPicRightClick off
  window -c @ViewPicRightClick
  unset %ViewPicRightClickURL
}
On *:Active:*:{ if ($lactive == @ViewPicRightClick) { ViewPicRightClickDone } }
On *:AppActive:{ if ($window(@ViewPicRightClick)) { ViewPicRightClickDone } }
Menu * {
  rclick:{ if (*Typos $+ $chr(160) $+ ViewPic* iswm $mouse.win) && (!%anigifcurrent) && ($timer(viewpicslideshow)) { .timerviewpicslideshow off } }
  sclick:{
    if (*Typos $+ $chr(160) $+ ViewPic* iswm $mouse.win) && (!%anigifcurrent) {
      if ($timer(viewpicslideshow)) {
        .timerviewpicslideshow off
        return
      }
      if (%viewpicmode != zoom3) { set %viewpiczoom - $+ $calc($mouse.x * $iif(%viewpicmode == zoom,1,$iif($v1 == zoom2,1.5,.5))) - $+ $calc($mouse.y * $iif(%viewpicmode == zoom,1,$iif($v1 == zoom2,1.5,.5))) }
      set %viewpicmode $iif(%viewpicmode == fullscreen,fullscreen,$iif(%viewpicmode == zoom,zoom2,$iif($v1 == zoom2,zoom3,$iif($v1 == zoom3,fullscreen,zoom))))
      ViewPicModes $mouse.win
    }
    if ($mouse.win == @ViewPicRightClick) {
      if ($mouse.y isnum 1-12) {
        clipboard %ViewPicRightClickURL
        ViewPicRightClickDone
      }
      elseif ($mouse.y isnum 22-33) {
        url -an %ViewPicRightClickURL
        ViewPicRightClickDone
      }
      elseif ($mouse.y isnum 41-52) {
        url %ViewPicRightClickURL
        ViewPicRightClickDone
      }
    }
  }
  -
  <[Typos ViewPic]>
  .Open a Picture:ViewPic
  .Open the photo album:dialog $iif($Dialog(ViewPicalbum),-evo,-mdo) ViewPicAlbum ViewPicAlbum 
  .Start a slideshow:{ viewpicslideshow } 
  .Control Panel:dialog $iif($Dialog(ViewPic),-ev,-md) ViewPic ViewPic
  -
}
;End everything needed for the Right Click Menu. The dclick and the <[Typos ViwPic]> section is not needed for the custom right click menu.
On *:UnLoad:{
  ViewPicUnsetRunning
  unset %ViewPic* 
}
;End Typos ViewPic 

Comments

  (90)  RSS
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 20, 2008 4:33 am
As usual all comments and ideas are welcome. I'm already considering some updates like maybe making it so you can resize the window and ofcourse the picture would resize with it.

Hope you enjoy it.
erry
Comments: 13
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 20, 2008 4:39 am
THAT'S JUST SO !@#$ COOOL
DragonFlare
Comments: 117
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 20, 2008 5:43 am
Excellent script as usual typo

and what chatscape server is that in the screenshot?
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 20, 2008 6:04 am
Ok, someone just found a couple of animated gifs that arent working properly after going thru a whole big bunch of em. I kind of expected this as the animated gif part was very hard to do since mirc has zero support for it and I knew I wouldn't be able to play them all. I will work on adding code to either make these newly discovered animated gif types work or have it display an error message and show you the first fram as it does with the other animated gifs that it knows it cannot display.

You will know if you found one of the two new formats I speak of if the animated gif only shows a still picture but didnt give a warning first or if the animated gif displays all the frames but part of the picture in most the frames is missing.

I still feal that being able to view 80 percent or so of animated gifs is worth keeping the feature.
jonesy44
Comments: 1,892
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 20, 2008 6:35 am
Psh! Ya'll are copying my original script xD

Nice one typo though. looks good :]
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 20, 2008 6:44 am
Copying your original script?
Which script ya talking about. When I went to make this I couldnt find a script like it anywhere.
And who is yall?
:)
jonesy44
Comments: 1,892
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 20, 2008 6:49 am
http://www.hawkee.com/snippet/4446/

I don't believe mine is anywhere near as good; but it was when i was experimenting with sockets. i like the look of this script though.

And there have been 2 of this kinda script recently :P
Eugenio
Comments: 1,178
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 20, 2008 8:26 am
Im glad this got rated 10 tbh
I gave you all my ideas on /server IRC.CHATSCAPE.NET:6667 ;p when I think of any = /me comments
/me rates 9
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 20, 2008 8:49 am
Wow jonsey44, I cant believe I didnt find yours when I was looking for them when I started this script and yeah I saw the other scripts your talking about but I like mine better since its mine. Lol. Really tho they're all different in some important ways. I believe mine is best for downloading and viewing but that image uploader and viewer is pretty nice script too and the animator was also pretty nice and just fun to toy around with for a few minutes when testing it.

Still, Im pretty proud of this script and I'm glad its getting a good rating.

Thanks everyone.
pwnisher3
Comments: 188
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 20, 2008 7:50 pm
how do you get the screenshots ont the snippet info?
Hawkee
Comments: 1,091
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 20, 2008 7:52 pm
pwnisher3, go to http://www.hawkee.com/profile/photo_upload.php to upload an image. Then view the full size image page to get the bbcode which you simply paste into the snippet description.
pwnisher3
Comments: 188
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 20, 2008 7:53 pm
ok thanks hawkee
NIGathan
Comments: 208
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 21, 2008 3:27 am
Both http://media.fukung.net/images/4914/beards.gif and http://media.fukung.net/images/6723/kraker.jpg failed to do anything except show 0% then disappear. I never saw the actual image :/
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 21, 2008 4:25 am
Good find Nigathan. Thanks.

A quick look revealed that it was using cookies so I added a sockwrite line with Cookie: PHPSESSID="";Path="" in it and then the server returned a line saying that transfer encoding was chunked.

Chunked transfer encoding totally changes the way the file is transfered. One big difference is that it doesnt seem to tell me the file size ahead of time, your left to discover it on your own somehow which makes the progrss bar unusable when I do get the file transfer nailed. The second main difference is the fact that the data is sent in chunks as the name suggests and each chunk has a header that in hex tells the length of the chunk.

Luckily shortly after I started coding for the chunked transfers it occoured to me to try sending the http request as 1.0 instead of 1.1 and that almost worked but it still needed a new sockwrite line with Accept-Range:Bytes and, BAM, it works like a charm now.

Code has been updated.

EL
Comments: 1,114
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 22, 2008 2:21 am
Loosk good Typo.Everything i tested before you posted worked didnt find anything wrong liek the custom right click lil flare there;p.Very cool and about time to ffs need some good codes posted here on hawkee.Well done man as to be expected i suggest you post it n other irc coding sites i think it needs more exposed.That said,can we bump snippets ,eh fack it BUMP.Code needs more comments and rates ffs."Rate it or Hate it?"...8/10.`-.-´
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 22, 2008 3:37 am
Thanks a lot EL,

I'm working on a resize feature at the moment. It lets you resize the picture by resizing the window. You can hit any key to toggle the picture size back to normal and after that pressing any key again will toggle betweem normal and full screen like normal.

Should be done tonight I hope. I started it earlier today and I already have it working on all the pictures except the animated gifs which take a lil different approach so I'm working on that now.
Eugenio
Comments: 1,178
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 22, 2008 4:36 am
The custom right click pwnz its just blury......for me anyhow
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 24, 2008 3:22 am
I have added the ability to resize the pictures. It works just like resizing any other window and the picture will automatically resize with it. Toggling the size back to normal works just like toggling between the normal view and fullscreen. You can right click and select normal view or simply press any key. After the picture is returned to normal the toggling action returns to going between the normal and fullscreen views again.

This will remain a work in progress even when I start on my next project once I can decide on one so alway keep an eye out for updates with more new features and fixes.

Enjoy.
EL
Comments: 1,114
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 25, 2008 5:17 am
Nice update Typo.After a lil bugg testing works fine now >D.Cool that it resizes that was a good idea and worth the time.Hope some other ppl can test && comment on this its useful to most im sure.Still stand by my 8.`-.-´
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 25, 2008 5:25 am
Thanks EL and I really appreciate you catching that error and pointing it out to me so I could fix it and yeah, god knows I sure wouldn't complain if more people told me what they thought of this or just rated it.

EL
Comments: 1,114
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 25, 2008 5:32 am
Rofl yeah well if there wasn't a huge draw to fail scripts before workin usefull scripts im sure there would be more comments.Users tend to comment on scripts that arent coded well and or ripped/butchered ,there just seems to be more to say about those types.Good and usefull scripts are like ''works good /me rates'' shrugs.Dunno i sure ppl once they use it will comment and rate,but atleast you made something someone will use.rofl funny your gunna see this in 15 seconds or less in #mIRC_Or_GTFO.`-.-´
Zmodem
Comments: 306
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 25, 2008 11:21 am
This is just OUTSTANDING! +10 Typo :-) Just right off the bat, the only thing that is simply overlooked was when you go to Open Picture', and then you click Cancel instead of selecting a picture, it brings up the Select Picture dialog again, and once again, you have to click Cancel. Also, it still gives you the error about not picking a proper image file. I guess the best way to fix it would be just
Code:
if (!$sfile()) { return }
Anyways, if I come across any other tiny things, I'll let ya know.

I'd like to reiterate, this is seriously an awesome coding job!
Eugenio
Comments: 1,178
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 25, 2008 12:24 pm
now I keep getting some sh1tty error bout how the file type aint suported even tho it worked on those pics before.
-.-
Zmodem
Comments: 306
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 25, 2008 12:31 pm
I think that it would be cool if it remembered the last folder you picked a file from, that way you don't have to keep going back to the scriptdir everytime.
Zmodem
Comments: 306
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 25, 2008 2:12 pm
Hey, I must admit that now, I'm starting to have problems using this. The line, ie: 245, where you have /rename, is unnecessary, because you've already got the .copy -o ViewPicDLFile.tmp " $+ %ViewPicSavePath $+ %OriginalName $+ ". When you attempt your rename function, it errors saying that it cannot be done.

As well, if the socket tells you there's nothing to read, your @window stays open, just long enough to wait for the timeout. Shouldn't it close right away?

One more thing, why when you do comparisons do you check if ($this == $true)? You don't need == $true, because the if statement automatically will do that. So: if ($this) { it's $true so do stuff }. I don't know, it might be preference ;)

Anyhow, it seems to work just perfect for me on almost everything, save for a plethora of animated gifs, as you've already mentioned.
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 26, 2008 2:31 am
I have such a bad habbit with the == $true thing but im working on it...Il clean those out.
Ill look into the timeout thing too. Also Im going to do a once over on the script today because I am going to change the way it temporarily stores the file name. While I do that I'll look into adding the storing of the last viewed folder. Also, that line with the copy u pointed out was actually supposed to start with "if (%viewpicdl == yes)" which ill fix in the upcoming update and will then only copy the file to the dl folder if the user has that enabled. The script works with the copy of the pic thats in the mirc folder.

Thanks for the comment and keep an eye for the new update coming soon. Either in the next 4-5 hours or by tomorrow.
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 28, 2008 9:28 am
It's a day or two later than I had hoped but here it is.
*Updated*
1. Made a whole new timeout system that uses the http standard timeout scheme which times out if the speed falls below 150 bps. It also timesout after 2 minutes (adjustable).
2. The socket now has better handling of dead url's or links to files that arent really there but the server tries a redirect and I made improvements and fixes to the sockclose event.
3. Made fixes to the recently added resize system after I noticed a problem with the way it worked.
4. Changed the way the script stores the file name while running. It used to store the whole path and filename int he titlebar but since having only the filename there looks better I am now using a variable to store that info.
5. The script now remembers the last folder you were browsing in when loading a picture locally and opens in that folder the next time.
6. Now checks on install to make sure you are running mirc 6.3 or higher. (This means a future update will likely include moving "" back to $qt and going back to using noop. I was trying to make the script compatible with older versions but in the end had no luck.
7. On top of that there are a lot of various code changes and/or fixes throughout the entire script.

Please post any problems, ideas or comments.
Enjoy.
EL
Comments: 1,114
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 28, 2008 9:56 am
Looks good i ll have to test it.`-.-´
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 28, 2008 10:03 am
Honestly aside from the script remembering where you were last time you browsed for a file you won't actually see any differences except for the new part in the dialog for setting the timout for when its downloading. Most the changes were more behind the scenes so to speak but I do appreciate you testing it again since I did change an aweful lot of stuff.
EL
Comments: 1,114
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 28, 2008 10:27 am
Well looks good man nice that you added the timeout ;s could be a pain for some other wise.Run smooth and efficient so alls good.`-.-´
Zmodem
Comments: 306
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 28, 2008 3:34 pm
Typo: Outstanding! I didn't have a single issue with it. The error checking is beautiful! Great job! :-)
Scakk
Comments: 312
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 28, 2008 3:45 pm
I tested it with 6.21 ( I know I should upgrade but meh ) and only got the below errors.

* Invalid format: $round (line 2200, WaiterJohn) <-- Open normal pic to fullscreen.

Code:

  var %ViewPicNSWidth $round($iif(%ViewPicPW !> %ViewPicNW && %ViewPicPH !> %ViewPicNH,%ViewPicPW,$iif(%ViewPicPW > %ViewPicPH,$iif(%ViewPicPW > %ViewPicNW,%ViewPicNW,%ViewPicPW),$iif(%ViewPicPH > %ViewPicNH,$calc(%ViewPicNH / %ViewPicAspect),$calc(%ViewPicPH / %ViewPicAspect)))),0)


* Invalid format: $round (line 2291, WaiterJohn) <-- open animated pic ( .gif )

Code:

  var %AniGifWidth $round($iif(%AniGifPW !> %AniGifNW && %AniGifPH !> %AniGifNH,%AniGifPW,$iif(%AniGifPW > %AniGifPH,$iif(%AniGifPW > %AniGifNW,%AniGifNW,%AniGifPW),$iif(%AniGifPH > %AniGifNH,$calc(%AniGifNH / %AniGifAspect),$calc(%AniGifPH / %AniGifAspect)))),0)



Other than that no issues to report.
Zmodem
Comments: 306
 
mIRC Snippet:  Typos ViewPic
Posted on Aug 28, 2008 4:04 pm
Typo: I've a suggestion: When you double-click on the normal-sized pic, how about it full-screens it, and vise-verse. In fact, your Menu * can be changed for just that. Here ya go:

Code:
Menu * {
  sclick:{
    if ($mouse.win == @ViewPicRightClick) {
      if ($mouse.y isnum 1-12) {
        clipboard %ViewPicRightClickURL
        ViewPicRightClickDone
      }
      elseif ($mouse.y isnum 22-33) {
        url -an %ViewPicRightClickURL
        ViewPicRightClickDone
      }
      elseif ($mouse.y isnum 41-52) {
        url %ViewPicRightClickURL
        ViewPicRightClickDone
      }
    }
  }
  dclick:if (*Typos* iswm $mouse.win) ViewPicFullScreen %ViewPicTitle
  -
  <[Typos ViewPic]>
  .Control Panel:dialog $iif($Dialog(ViewPic),-ev,-md) ViewPic ViewPic
  .Open Picture:ViewPic
  -
}
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 1, 2008 1:03 am
Zmodem, thanks for the idea and I will include it in the next update for you but for the future, I do not require code examples when giving me ideas, especially when its something as simple as a dclick event. I think the fact that you put it below a sclick event, that I made, makes it kind of obvious that I would know how to do it myself and besides, I prefer to do my own coding and ever prefer to figure things out on my own when I don't know how to do them. Sorry if that came off as rude as I didn't mean it that way and do appreciate your idea(s) a lot.

Sckak, I will be changing the introduction to say the sript only supports 6.3 and higher since I found that to be true. I added a version check to the On Load section in the last update but forgot a closing bracket so it didnt trigger for you. I fixed that and then realized I also forgot to change the intro to reflect the version 6.3+ requirement so I will edit that now.

I am already working on the next update so keep watching for it. Included will be the ability to scroll through the images in the current folder. For instance, if your looking at a picture in c:\mirc, you can scroll forward or backward through all the images in that folder by using +/- , LeftArrow/RightArrow, PgUp/PgDn or the right click.

I also want to thank everyone who has rated this script and/or selected it as "Liked". You can never get too much positive feedback as far as I'm concerned. :)
Zmodem
Comments: 306
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 2, 2008 5:01 pm
Typo: My bad! I should have known better than to show you a code example! The reality of the thing was I added it to the snippet you submitted already, so I just pasted it, in haste. My apologies! :-)
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 4, 2008 9:12 am
Now includes a photo album!

*Updated 09/04/2008*
1. Added a photo album. It displays 16 photos a page lets you simply double click a picture to open it in viewpic. You can select what folder to view and it will remember the folder for the next time you open the album. You can also delete files from within the photo album by single clicking a picture to select it and then using the delete button.
2. Added the ability to double click a picture to toggle between normal and fullscreen view as requested by zmodem.
3. Fixed a bug that wasn't copying the file like it was supposed to when the save downloads option was enabled (this problem was from the previous update).
4. Various other small fixes/updates.

The scrolling through photos in normal view mode feature is still coming but will be in the next update. When I decided to do the album it became a proprity.

As usual, all comments and ideas welcome.

Enjoy.

To Zmodem: I recently noticed you making a lot of posts around here so when you posted to me and felt that you needed to provide a code I just wanted to let you know for future reference that I don't need a code example when you give me an idea and especially when its obviously something that I could code myself. As i said before, I wasn't trying to be rude and in fact am very appreciative of your idea(s).

To whoever voted this a 1 and brought my score from 9.2 to 8.0 I just want you to know that nobody likes you and you suck.
^Neptune
Comments: 629
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 4, 2008 9:15 am
The album is a really neat idea. The best thing about this is the downloading an image by simply clicking the link in the channel. It's absolutely awesome. Great job, 10/10
EL
Comments: 1,114
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 4, 2008 10:41 am
Nice another great update;p well done J.`-.-´
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 4, 2008 12:01 pm
Thanks EL and Neptune, I think people are going to really like the photo album addon.

This is still a work in progress so ideas are always welcome. Soon to come is the ability to scroll forward or backward through the pictures in the folder of the currently loaded picture and I plan on having the photo album warn a user when the folder they change to has no photos in it.

All the Likes and positive ratings are greatly appreciated.
Eugenio
Comments: 1,178
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 4, 2008 12:02 pm
`-.-´
^Neptune
Comments: 629
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 4, 2008 12:29 pm
Maybe a feature that lets you post an image to say, tinypic. But it's not exactly called PostPic is it. lol
Eugenio
Comments: 1,178
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 4, 2008 12:34 pm
ffs
neptune please elaborate
-.-
^Neptune
Comments: 629
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 4, 2008 12:37 pm
..How can you elaborate that more? :/
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 4, 2008 12:39 pm
He means like the image uploader that was released a little while ago where it uploads the pic automatically and gives u the url but I dont think I will be adding anything like that but I will keep the idea in mind.

Thanks for the idea
Eugenio
Comments: 1,178
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 4, 2008 12:40 pm
not a bad idea I spose, but no need to add it so good
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 4, 2008 12:45 pm
Thanks eugene and I did ask for ideas since this is still a work in progress. I just think the uploader might be getting a little too far away from the original purpose of the script.

I'm sure theres still plenty to improve upon with the original viewpic parts and the the new photo album part but I'm very happy with the script overall.
jonesy44
Comments: 1,892
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 4, 2008 1:30 pm
var %ViewPicTmpInput $input(Sorry but this script requires mIRC 6.3 or higher to run.,o,ERROR

You're missing a ) bracket at the end.

also, instead of using a var. you could use /noop. Even you taught me that! XD
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 4, 2008 1:38 pm
Yeah I had taken all the noop's back to var trying to make it compaitble for oder versions. Thats also why you see " $+ blah $+ " instead of $qt( ) in a lot of places.

I plan on fixing all of them for my next update and I will fix that bracket mismatch right now.

I also repaired a problem with animated gifs and folders with spaces that neptune discovered.

Thanks for the comment tho. Did you like the photo album addon?
Zmodem
Comments: 306
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 4, 2008 3:28 pm
I loaded this up, opened 1 picture via Open A Picture, then I did Open the photo album and I got this in the status screen: * Invalid parameters: $findfile (line 502). I've pasted the cause below:

Code:
alias ViewPicFileList {
  if ($window(@ViewPicScrollAlbum)) { window -c $v1 }
  window -hw0 @ViewPicScrollAlbum

;----PROBLEM
  noop $findfile($qt(%ViewPicAlbumPath),*.jpg;*.bmp;*.png;*.gif;*.jpeg,0,1,aline @ViewPicScrollAlbum $1-)
;-----------

  filter -uwwct 0 32 @ViewPicScrollAlbum @ViewPicScrollAlbum *
}


Basically, the issue is that %ViewPicAlbumPath has not been set yet. Also, I'm not sure if this is because it's a work in progress, but the Change current folder. button on the photo album dialog does not work for me.
EL
Comments: 1,114
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 4, 2008 3:43 pm
;o
Eugenio
Comments: 1,178
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 4, 2008 3:53 pm
rofl
/me takes cover

erm I had that error aswell btw -.-
jonesy44
Comments: 1,892
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 4, 2008 4:09 pm
* Invalid parameters: $findfile (line 502, Testing.fos)

Can't select folder.

Also those "." at the end are kinda annoying..
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 5, 2008 7:12 pm
Sorry I didnt reply sooner but Ive been a little busy irl and only now saw the post.

I will be posting an update soon to resolve the issues mentioned and it will also include the new scrolling through pictures feature and some other smaller fixes/changes including cosmetic fixes on the photo album dialog w/removal of the periods jonsey mentioned.

The variable not being set was related to the on load not functioning right which will be fixed.

The button to change folders always worked for me but I believe I found an issue that may be causeing a problem.

I will have the update uploaded shortly since the other additions were actually ready to be uploaded.
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 6, 2008 11:06 am
Ok, every problem that was discovered since the update has been addressed and some additional fixes and updates have been made as well.

1. Added the ability to scroll forward and backword a picture at a time in the folder of the currently loaded picture using either +/-, PgUp,PgDn, LeftArrow/RightArrow or the right click menu. This is for when viewing photos normally, not in the photo album.
2. Added a button in the photo album to open the currently selected folder.
3. Fixed the file display in the photo album to not include the path since the path is already displayed up top.
4. Fixed the photo album dialog to display immediatley after deleting a file instead of loading the images and then making the dialog visible again.
5. Multiple minor visual fixes to the photo album dialog.
6. Fixed the On Load event to function properly.
7. Fixed the timeout system to avoid false timeouts.
8. Various other bug fixes and coding updates.

This update had a lot of small code changes through the script on top of the listed fixes and updates so I tested this on my mirc, a fresh mirc, and asked a few people to try it and everything seems to be ok but please let me know of any errors you may run into.

As usual, all comments and sugggestions are welcome.

Be sure when updating to unload the old copy and then load the new copy.

Enjoy.
EL
Comments: 1,114
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 7, 2008 4:59 pm
/me enjoys ;o and are you renaming it or what?
Eugenio
Comments: 1,178
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 7, 2008 5:04 pm
Yeah use the longer name when you rename it
/me cant wait for updates ^_^
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 7, 2008 5:12 pm
I would like to rename it but cannot decide on a name. I still say Typos Picture Viewer and Photo Album is a bit too long but i want the title to describe the fact tht its a pic viewer and a photo album so I dunno.....

Keep in mind that the name is also in the titlebar of the dialog for the pictures and photo album and is in the menus in so a huge name like the one above has actual effects on the appearance of things.

All serious name suggestions are welcome.
Eugenio
Comments: 1,178
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 7, 2008 5:30 pm
Picture Viewer and Photo Album
seems fine to me ;o
^Neptune
Comments: 629
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 7, 2008 5:39 pm
Typo's Picture Center
^Neptune
Comments: 629
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 7, 2008 5:59 pm
Suggestion: A zoom function would be very nice indeed
Xpl0reR
Comments: 227
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 7, 2008 6:37 pm
my script is lagging as hell since i got this remote in it, but this is nice work.

10/10
Eugenio
Comments: 1,178
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 7, 2008 7:23 pm
@Neptune
stop riping my ideas, I suggested that AGES ago wtf ;o
/me infuriates
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 7, 2008 7:30 pm
Eugene noticed that the timeout issue was still periodically happening even with the new timeout scheme updates so I asked for his help to find out why he was having the issue and we finally figured it out with some creative echoing.

I came up with a fix and have uploaded it but this problem affected only toe people as far as i know so if you weren't having any issues with downloads ther is no need to update if you already have the last update from 09/06/2008 <yesterdy>.

XploreR, I'm not sure why my script would cause any lags but I'm glad your enjoying it.

Thanks for idea and name suggestion neptune. Ill look into a zoom feature and see how doable it is since your not the first to ask.

Keep the name ideas and any other suggestions coming everyone.
Hawkee
Comments: 1,091
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 7, 2008 9:20 pm
How about TypoPhoto.
Xpl0reR
Comments: 227
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 7, 2008 9:47 pm
/me Suggest -> Tp-viewer

stands for Typo's Pic Viewer
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 7, 2008 9:50 pm
Ok, for the renaming. I'm making a list of possible names so people can get some ideas or say what they like, even if it's the current name.

We have the current name:
Typos ViewPic

The current list for new names is:
Typos Picture Viewer and Photo Album
Typos Picture Viewer and Album
Typos Image Viewer and Album
Typos Picture Manager
Typos ViewPic and Album
TypoPhoto
Typos Photo Center
Typos Pic Viewer aka TP-Viewer
Typos Image Center
Typos ViewPix
Typos Picture Center

Try to keep in mind I want the name to try and describe that it can view photos and that it has an album but I'm open to anything.

p.s. For anyone that is unaware, an update was released for this script on 09/06/2008 <yesterdat> so if you havent grabbed it be sure to do that.
jonesy44
Comments: 1,892
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 8, 2008 10:56 am
Can you try and get rid of saying "Typo" everywhere. im sure your proud! but it gets soo annoying when people advertise kinda..
Eugenio
Comments: 1,178
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 8, 2008 11:00 am
I was gonna say that too
the reason why I changed my second last comment to Picture Viewer and Photo Album
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 8, 2008 7:41 pm
Every one of my scripts are titled like that. It's just how I've always done it and I really don't see any reason to change it. Would you ask Microsoft to drop the word Microsoft from all of their titles? We may call if Office but its Microsoft Office. Same with Adobe or Macromedia, every application titles start with their name.

I know Typos isn't a company name but it serves the same purpose which is to make my stuff stand apart and be easily identifiable. When you see a tite starting with Typos there is no doubt who made it. Someone who likes my stuff can easily find more and someone that hates me can easily avoid it.

Sorry if it bothers you but it's something I won't be changing.

Keep the name ideas coming tho. The newest suggestion is Typos Image Center.
EL
Comments: 1,114
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 8, 2008 7:45 pm
Ill go with Typos Image Center;p.`-.-´
Eugenio
Comments: 1,178
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 8, 2008 7:47 pm
Yeah thats not a bad idea since its not too long and that does describe the code tbh
EL
Comments: 1,114
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 8, 2008 7:52 pm
Or or Typos Super Image Epic Win Manager;o
Eugenio
Comments: 1,178
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 8, 2008 7:53 pm
/me rolls
nah bruv
^Neptune
Comments: 629
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 9, 2008 10:55 am
I think the first 5 or so names are too long imo.

Typo's Picture Center/Manager would be good because you could then expand it to upload images to a site, or do many other things with the images.
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 21, 2008 4:10 am
New update adds zooming and a slideshow feature!

*Updated 9/21/2008*
1. Added the ability to zoom in by left clicking on the image. Wherever you click is where it will center the zoomed image. The first click will zoom to 1.5x, the second click zooms to 2x, the third click zooms to 2.5x and the click after that will return you to the normal view. Pressing any other key at any time during the zoom process will also return the view to normal.
2. Added a slideshow feature. You can select "Start a slideshow" from any of the rightclick menus and also by using the slideshow button in the photo album. To stop the slideshow simply hit any key or click with the mouse. The delay between photos is adjustable in the viewpic control panel and defaults at 4 seconds.
...If you run the slideshow when a picture is not loaded it will default to the viewpic's save folder which is set in the control panel. If you start it by right clicking on a picture it will use the folder of the currently loaded picture and using the button in the photo album will start a slideshow in the whichever folder the photo album is in.
3. Fixed an error with the aspect ratio in the full screen view which went undiscovered until now due to the small amount of affected photos.
4. Various other smaller bug fixes and coding updates.

I was going to add support to set the current image as the background in mirc and infact had added it to the script with a nice dialog of its own with all available options but there was problems.
It seems to act funny when setting backgrounds in a large amount of windows/channels. If too many channels are open the backgrounds start acting up by actually dissapearing and even worse it would no longer allow the viewpic script or the viewpic photo album to load images properly so I decided to not support the option at all and removed all the 100+ lines of code I had added when adding the feature.

Like always, if you have any problems or any comments for future updates feal free to comment.
Blitzjager
Comments: 192
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 21, 2008 5:22 am
This looks great! Can't wait to try it. (Or break it. :3)
I'm not sure if you're still changing the name but I'd go with TypoPhoto or Typo's Picture Manager.
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 21, 2008 5:42 am
Thanks for the comment and yes I am still considering a name change but I am having a difficult time deciding what to change it to if I do so it was not included with this new update. It's a tuff decision. I will bring the list of names back down to the bottom of the comments pretty soon since its getting pretty far up. For now tho I would rather people notice the new update I just uploaded.
mountaindew
Comments: 1,816
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 21, 2008 9:21 am
This is really nice Typo, I give it a 10/10 :)
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 21, 2008 6:35 pm
Thank you very much mountaindew. :)

EL noticed a problem with the new zoom feature in todays update that made it offset the picture a little bit when returning to normal view on the fourth click. I have fixed that now and updated the code. Thanks EL.


EL
Comments: 1,114
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 22, 2008 4:05 am
Workin good typo nice job.Maybe add searching i cant remember if it doesn cause i unlaoded it with the rest of my test script from all yew fukin hawkeer's;p but i ll have to load it up and use it and im to damn lazy to scrol up to see the features but if not searchin for pix would be cool.`-.-´
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 22, 2008 5:07 am
Great idea. I'm going to think on it, like where to have it look and how to handle the results and so on.

Thanks for the idea!
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Sep 22, 2008 7:09 am
So, I'm pretty sure I'm going to use http://www.picsearch.com for the image search idea unless someone can give me a great reason not to.

The site is perfect in every way for getting information from using sockets and I personally like the search results.

The results are always different than google or yahoo because they have their own search engine and they filter out all the porn pretty well so the results are nice and clean and family friendly.

I will be starting on this idea tomorrow so if anyone has any other ideas for sites to use or any good reason for me not to use the one I picked than now is the time to mention it.

Thanks.
a careful warchild
Comments: 240
 
mIRC Snippet:  Typos ViewPic
Posted on Oct 4, 2008 2:57 pm
well, i have tested, and read through the intro, my only critism was 1 typo in the intro ;) which i told you about in PM, other than that amazing. Typo you never cease to amaze me :P, definetly 10/10 and +1 like, im sure i will be using this alott :P
Blitzjager
Comments: 192
 
mIRC Snippet:  Typos ViewPic
Posted on Oct 4, 2008 4:01 pm
Not a big deal but sometimes when I get a download error the download % bar stays up for a few secs.
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Oct 4, 2008 4:07 pm
Thanks a lot a careful warchild.

Watch soon for my next update that adds online image searching capabilities. It's currently in the testing phase.

Thanks for the comment tho, I'm glad you like it.

Blitz, I believe I already addressed that issue in the next upddate but if it still happens after the image search addition please let me know so I can fix it.

Thanks for the comment.
Typo
Comments: 224
 
mIRC Snippet:  Typos ViewPic
Posted on Dec 9, 2008 8:23 am
I wanted to apologize to anyone waiting for the release of the next update which adds online image searching abilities. Things got really busy for me the past couple months and I haven't had time for any kind of coding till past few days. I will resume the testing for the update very soon and then release it if it's good to go.

Sorry for the delays.
^Neptune
Comments: 629
 
mIRC Snippet:  Typos ViewPic
Posted on Dec 9, 2008 8:34 am
Still can't connect to your server Typo o_O
CharltonJ
Comments: 44
 
mIRC Snippet:  Typos ViewPic
Posted on Dec 25, 2008 8:21 am
wow, nice :D
Hawkee
Comments: 1,091
 
mIRC Snippet:  Typos ViewPic
Posted on Mar 7, 2009 5:56 pm
I'm not sure why, but I'm getting the following error when I try to view the next or previous picture:

VIEWPICSCROLL($!ACTIVE).F Unknown command

I'm running mIRC 6.35 on Win XP.
FiB3R
Comments: 1
 
mIRC Snippet:  Typos ViewPic
Posted on Jul 15, 2009 5:53 pm
Great script, thank you.

I have a multi monitor setup, and choose to have my channel windows on the desktop rather than within mIRC, and I keep the main mIRC window minimised most of the time.

Would it be possible in a future revision, that when clicking on an image link, the image opens on the same screen as the channel window? And perhaps more importantly (to me at least) that it ignores the window transparency settings?

Slightly transparent windows can look pretty cool on a dark background when it's only text, but it totally ruins an image.

Thanks again :)

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  

Bottom