Auto Updating Image

DataMine
by DataMine · 9 posts
11 years ago in Javascript
Posted 11 years ago · Author
Since I am still new to Photoshop, when I use it, I like to see in real time what changes I make look like on the final image. I used to use Windows native picture viewer for this because it would automatically refresh the image when a change was made to the file. In Windows 8 however, this seems to no longer be the case. So below is the code I now use instead.

The code is very simple, the javascript itself was taken from javascriptkit.com (http://www.javascriptkit.com/script/scr ... resh.shtml). The rest is just your very basic html code for displaying an image.

Code
<html>
    <head>
      <style type="text/css">
         body {
            background-color: #D3DFD1;
         }
      </style>
      <script>
         <!--
         /*
         Auto Refresh Page with Time script
         By JavaScript Kit (javascriptkit.com)
         Over 200+ free scripts here!
         */

         //enter refresh time in "minutes:seconds" Minutes should range from 0 to inifinity. Seconds should range from 0 to 59
         var limit="0:2"

         if (document.images){
            var parselimit=limit.split(":")
            parselimit=parselimit[0]*60+parselimit[1]*1
         }
         function beginrefresh(){
            if (!document.images) {
               return;
            }
            if (parselimit==1) {
               window.location.reload()
            }
            else {
               parselimit-=1
               curmin=Math.floor(parselimit/60)
               cursec=parselimit%60
               if (curmin!=0)
               curtime=curmin+" minutes and "+cursec+" seconds left until page refresh!"
               else
               curtime=cursec+" seconds left until page refresh!"
               window.status=curtime
               setTimeout("beginrefresh()",1000)
            }
         }

         window.onload=beginrefresh
         //-->
      </script>
    </head>
    <body>
        <center><img src="" /></center>
    </body>
</html>


Basically, this is simply an html file with an image that is refreshed automatically at a specific time interval. When the page gets refreshed, it re loads the image, there by updating it.


To use this file, follow these steps:

Step 1) Copy the code above and paste it in notepad (or your preferred text editor).
Step 2) Save it as "updateimage.html" (without quotes) and put it in the same location as your image. This can be a folder or just your desktop for example.
Step 4) Edit the code to suit your needs:

To change the amount of time between page refreshes, edit the line below. Enter refresh time in "minutes:seconds" Minutes should range from 0 to inifinity. Seconds should range from 0 to 59:
Code
var limit="0:2"


To change the image, edit the line below. Put the full path to your image, including the extention (.png/.jpg/gif etcc..):
Code
<img src="" />


Step 5) Save your changes.
Step 6) (optional) Open the "updateimage.html" file in your web browser and move it to your other monitor.

Done!

Notes:
-Sometimes Photoshop will error if you try to save the file while the page is refreshing because the file will be in use. Just try again.
-Only works well on dual monitors.
Posted 10 years ago
This code is Brilliant. I already have lots of ideas about how i am going to use it. You're the best, Miner.
Posted 10 years ago · Author
Leshrac wrote:
This code is Brilliant. I already have lots of ideas about how i am going to use it. You're the best, Miner.


Awesome, glad to hear it!

You can also replace all of this code with 1 line of html
Code
<meta http-equiv="refresh" content="5">


Just change the "5" to however many seconds you want.
Posted 10 years ago
Thanks again!, that's going to be rather helpful
Posted 10 years ago
Shame, I can never wrap my head around Photoshop, so I stick with GIMP.
Posted 10 years ago · Author
BloodLustD wrote:
Shame, I can never wrap my head around Photoshop, so I stick with GIMP.


I'm still learning it. You just gotta open it and mess around with it, watch a few tutorials too.
Posted 10 years ago
Sounds like a good idea, I might try it out, it can't do nothing but help me to master another software, as more people use Photoshop nowadays, anyone got any idea on how to obtain a free Acrobat Adobe PDF Subscription lol
Posted 10 years ago
Photoshop is the best....
Posted 10 years ago · Author
BloodLustD wrote:
anyone got any idea on how to obtain a free Acrobat Adobe PDF Subscription lol


http://extratorrent.com/torrent/2839051/

Create an account or sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here

SIGN IN NOW

Create an account

Sign up for a new account in our community. It's easy!

REGISTER A NEW ACCOUNT
Select a forum Protection     Help & Support     Introductions     Mafia News     IMVU News General Discussion     IMVU Lounge        IMVU Series / Roleplaying        Social Games     Mafia Market     Mafia Tools        Premium IMVU Tools        Off Topic Tools     Off Topic     Contests Creator Corner     Graphics Design        Photoshop        GIMP     Basic Creator Help     Catalog And Product Showcase     3D Meshing        3Ds Max        Sketchup        Blender Gangsters with Connections     White Hat Activities        Google Hacking        Trackers Programming Corner     Coding        Python        .Net (C#, VB, etc)        Flash        JAVA        Autoit        Batch        HTML & CSS        Javascript        PHP        Other        IMVU Homepage Codes           General           About me Panel           Messages Panel           Special Someone Panel           Visitors Panel           New Products Panel           Rankings Panel           Wishlist Panel           My Badges Panel           Outfits Panel           Url Panel           Groups Panel           Slideshow Panel           My Room Panel           Sandbox panel           Layouts     Help & Requests Free Credits     Approved Methods     Submit Methods Free Money     Approved Methods     Submit Methods Adult Corner     Get Mafia AP Here     AP Lounge        AP Social Games        Casual Dating Tips     IMVU Slave Market & Escorts