Auto Updating Image 9 posts

OP Thu Mar 21, 2013 6:56 am
User avatar
Administrator
Legendary Family Member
  • Gender: Male
  • Posts: 6284
  • Joined: Jun, 2010
  • Advertisements: 45
  • Karma: 368
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.
Sun Mar 31, 2013 7:49 am
User avatar
  • Gender: Male
  • Posts: 82
  • Joined: Dec, 2010
  • Karma: 0
This code is Brilliant. I already have lots of ideas about how i am going to use it. You're the best, Miner.
OP Sun Mar 31, 2013 8:02 am
User avatar
Administrator
Legendary Family Member
  • Gender: Male
  • Posts: 6284
  • Joined: Jun, 2010
  • Advertisements: 45
  • Karma: 368
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.
Sun Mar 31, 2013 8:37 am
User avatar
  • Gender: Male
  • Posts: 82
  • Joined: Dec, 2010
  • Karma: 0
Thanks again!, that's going to be rather helpful
Mon Apr 01, 2013 12:45 am
User avatar
Legendary Family Member
  • Gender: Male
  • Posts: 937
  • Joined: Jan, 2013
  • Karma: 13
Shame, I can never wrap my head around Photoshop, so I stick with GIMP.
OP Mon Apr 01, 2013 8:32 am
User avatar
Administrator
Legendary Family Member
  • Gender: Male
  • Posts: 6284
  • Joined: Jun, 2010
  • Advertisements: 45
  • Karma: 368
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.
Tue Apr 02, 2013 5:32 am
User avatar
Legendary Family Member
  • Gender: Male
  • Posts: 937
  • Joined: Jan, 2013
  • Karma: 13
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
Tue Apr 02, 2013 6:28 am
User avatar
Lower Family Member
  • Gender: Male
  • Posts: 118
  • Joined: Jan, 2012
  • Karma: 0
Photoshop is the best....
OP Tue Apr 02, 2013 10:52 am
User avatar
Administrator
Legendary Family Member
  • Gender: Male
  • Posts: 6284
  • Joined: Jun, 2010
  • Advertisements: 45
  • Karma: 368
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