
![]() |
![]() |
![]() |
|
|||||||
![]() |
![]() |
|
Welcome to Talk Arcades, the premier forum for arcade webmasters. You are currently viewing our boards as a guest. By joining our community you will be able to make posts, communicate privately with other arcade webmasters and participate in our Live Marketplace. Registration is easy, so please join us today! |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#2 (permalink) |
|
Senior Member
Join Date: May 2007
Posts: 211
|
I am assuming by file size you mean dimensions (width/height) of the game and not the size as in number of bytes.
This looks like the sort of thing your looking for. Please note that this code was written off the top of my head and has not be tested at all so it probably has errors. If your try it I suggest that you backup your database before doing so. PHP Code:
If you just wanted to know specifically how to get swf dimensions then its the function "getimagesize()" and the width and height are the first two values in the array [0](width) [1](height) I hope it works and helps. If not just say so here. EDIT: made a few changes. noticed I had "or die(mysql_error()) twice at the last sql query. Last edited by hawkal : 07-09-2008 at 07:49 AM. |
|
|
|
![]() |
![]() |
|
|
#4 (permalink) |
|
Senior Member
|
Hawkal that's a nice script. I have one that I had written for me a few months ago. I added a field to games table that signifies if the game file has been resized, if it has then the script ignores it and I had a timeout built inbetween each game load to relieve server load issues. A thousand games takes about 4 hours with 15 second interval.
I like your idea about setting default sizes when condition are met. Good idea to add conditions to eliminate video files and dcr files too! |
|
|
|
![]() |
![]() |
|
|
#5 (permalink) | ||
|
Senior Member
Join Date: May 2007
Posts: 211
|
Quote:
Quote:
That's a good idea, did you have it check to see if it resized just incase the script terminated? or it would be useful on a host that limits script execution time. Another way you could relieve the server would be to limit the amount of games you resize at a time. I agree it is a good idea to check for video and dcr files and it would be quite easy for scripts that have the extention in the filename in the db. I might add more to it later on. |
||
|
|
|
![]() |
![]() |
|
|
#6 (permalink) | |
|
Senior Member
|
Quote:
phpas records the file type in separate field ... many scripts do. So to pick up just swf files need to find file type "1" I also have a neat script that resizes video files ... that one took some time as it requires a new library to be installed but man is it nice. |
|
|
|
|
![]() |
![]() |
|
|
#7 (permalink) |
|
Senior Member
Join Date: May 2007
Posts: 211
|
At least phpas has the right idea, like I said earlier gamescript doesn't do that so it has to get the file extensions on the fly every time a game is loaded.
Yea it's ffmpeg isn't it? Never used it myself, I remember someone on the gamescript forums talking about changing .wmv files to .flv on the fly with ffmpeg so that they could use a flash player. |
|
|
|
![]() |
![]() |
|
|
#9 (permalink) |
|
Senior Member
Join Date: May 2007
Posts: 211
|
Strange, even if it isn't able to get the file dimensions it should still set it to the chosen default.
Are you using the exact script I provided or have you modified it at all? (A part from sql info and the path to your .swf files of course.) |
|
|
|
![]() |
![]() |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| The Most Powerful Windows Application | Creature | The Lounge | 0 | 06-19-2006 04:02 AM |