Calculate The Size Of Image
How to calculate the size of image, using ASP technology. Size means total pixel X pixel and total number of bytes.
View RepliesHow to calculate the size of image, using ASP technology. Size means total pixel X pixel and total number of bytes.
View Replieshow to calculate image size and number of kb used.
View Replies View RelatedHow do I calculate the size of a folder? Also how do I count the number of images stored in a folder?
View Replies View RelatedIs there a simple function in ASP to calculate the dimensions of an image?
View Replies View RelatedI am having a problem with this code. The problem I am facing is that
the first image is displayed in its original size. But when I click the
next button, the next image not displayed in its original size, but
being displayed as 100 x 100 pixels, same goes to the 3rd picture and so
on. Code:
I only need to know the height and width of the image.
It doesn't seem to be as easy as php's "getimagesize($imgFile);" method.
<%
'Copyright *c* MM, Mike Shaffer
'ALL RIGHTS RESERVED WORLDWIDE
'Permission is granted to use this code
'in your projects, as long as this blah
'copyright notice is included
function GetBytes(flnm, offset, bytes)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFTemp = objFSO.GetFile(flnm)
lngSize = objFTemp.Size
set objFTemp = nothing
Set objTextStream = objFSO.OpenTextFile(flnm,1)
strBuff = objTextStream.Read(offset - 1)
GetBytes = objTextStream.Read(bytes)
objTextStream.Close
set objTextStream = nothing
set objFSO = nothing
end function
function lngConvert(strTemp)
lngConvert = clng(asc(left(strTemp, 1)) + ((asc(right(strTemp, 1)) * 256)))
end function
function lngConvert2(strTemp)
lngConvert2 = clng(asc(right(strTemp, 1)) + ((asc(left(strTemp, 1)) * 256)))
end function
function gfxSpex(flnm, width, height)
fileT=split(flnm,".")
if fileT(1)="gif" then
Width = lngConvert(GetBytes(flnm, 7, 2))
Height = lngConvert(GetBytes(flnm, 9, 2))
elseif fileT(1)="bmp" then
Width = lngConvert(GetBytes(flnm, 19, 2))
Height = lngConvert(GetBytes(flnm, 23, 2))
elseif fileT(1)="png" then
Width = lngConvert2(GetBytes(flnm, 19, 2))
Height = lngConvert2(GetBytes(flnm, 23, 2))
end if
gfxSpex=true
end function
if gfxSpex("images/urlogo.gif", w, h) = true then
response.write w & " x " & h
end if
%>
Which is a little bit shorter, and seems to work ok so far, but isn't there anything easier, like php's "getimagesize($imgFile);"?
i have a page that displays an image. the image path is a variable passed in the url link. eg. enlarge.asp?picture=http://www.hey/.com/you.jpg
and the window it opens works. but id like to try and get the enlarge as to get the height and width dimentions so i can call a new window to opena popup and ill dynamically have the images dimentions to scale the popup to fit.
and right after the javascript calls a new popup window itll use a close window function. and since it happens before the head tags it should be seamless as if i had a regular link calling a popup.
I have a table full of pictures with urls to images. Any idea how I could find out the dimensions of the images? i want to design tables to show them in a better way.
View Replies View RelatedHow can I get the height and width of a jpeg image?
View Replies View Relatedis it possible to have an asp script create a thumbnail of an image upon upload?
i want to create a rather small thumbnail and 65 x 83 and put it in a folder '/sized'
oh yeah, and one more quick thing.. i am pulling information from a database.. why is it that the symbol ' gets changed to a ? when pulling it from the field.. will this go away when i start adding information through forms instead of access?
The pic in the DB is just a named reference, as all the pics are stored in 2 common folders. 1 for the normal size pics and 1 for the thumbnail equivalents.
As this particular page has to be tight on space, I wanted to set the image as a percentage of it's size so I set the following:
<IMG SRC="thumbs/<%=picname%>' WIDTH="30%" HEIGHT=30%> etc....
Problem I have with this is that the browser seems to set all pics to 1 common percentage size rather than each being say 30% of each individual pic's size. This results in some piccies being completely distorted.
I don't want to go down the route of storing the x and y of each pic in the DB, so could you please let me know if I am doing something really stupid with the above.
My ASP app dynamically retrieves from db and sends JPG images using Response.BinaryWrite(). And it seems work. The script sets image type as "Response.ContentType = 'image/JPEG';"
But viewing image properties in IE returns Type and Size as 'Not available'.
How to set these properties properly?
Is there any routine I can call to reduce the size of an image file after
uploading a file from a client. I am looking to reduce file sizes
programmatically using C# in my web page after uploading. I know that
Photoshop can do it but I need to do it dynamically in my web page. I tried
doing it myself with some of the Bitmap thumbnail instructions but the
resulting image is very bad. I need a file reduction routine that creates a
good image that is smaller. I figured if Photoshop can do it then so can I
but how?
How to get the image size with VBScript in ASP?
View Replies View RelatedI am writing a little script for an online album. The pictures' size varies
a lot. I have a maxim size for every displayed picture because the layout
of the page. So I want to resize the larger one to that size while leave
the smaller one in their original size. Is there any script or code that
can do this automatically?
How can I use ASP to check the size of the images used in my solution?
This is what I need to do:
If the width of an image is more than 256px, I want to set the image width to 256px. Images that is smaller (ex: 100px width) shall not be adjusted.
I have a couple of images that the user can upload, but I want to limit the size to 512kb(most of them will come from a digital cam).
Is there a way to check the file size before the page submits? ie a javascript function that i can call before submitting the page?
I have an photo gallery, I want to create a button that opens a new window fixing the full size image snugley in it, which is easy.
But I want to get a script which detects the image size so i can use the variables to open the window.
What i want to not do is have to more options in the database with height and width in, and have to call them, although i'll do that if i have to, but i thought i would try something new.
Can u tell me how to control image size , its height and width and total size of image like that 13 kb. while uploading the file in asp?
View Replies View RelatedI want to specify the maximum length of an image the file can upload.If the image exceeds that limit it should show me an error.E.g.; 640x480 pixels.
View Replies View RelatedI'm using Windows 2000 server n IIS I'm Using FileSystemObject of ASP in Server Every File and Folder has 2 Size when we get properties of any 1 actual size and Size on Disk.now my problem is when i get the file size from ASP object it give Size value but when i try to get folder size it gives size on disk and both values are different.
I'm creating a size to access limited size to upload files so i just check the folder size and then get size for those which are going to update by user then i will less those size to actual folder size to get remaining size.
I am using a javascript function to draw a graph on my page, which all works fine. One of the parameters that I pass to the javascript function is the maximum value of the x and y axes.
I have encountered a problem, in that if I hardcode the maximum value of the y axis to 1000, and the maximum value that I am plotting is very low, eg 10, the bar is so small it can hardly be seen. It would be better in this case if the maximum y value was something like 15 to ensure that the bar went almost to the top of the grid.
The code which is doing the count is a simple loop which is looping through each of the months in the financial year counting the number of meetins which have occured in each month. Code:
Our store software currently displays the total amount saved (the list price minus our price) for every product using the code below:
'Calculate "YouSave"
If Product_ListPrice > 0 Then
Product_YouSave = Product_ListPrice - Product_LowestPrice
End If
I, however, would like to also diplay the percentage saved next to the amount saved. I tried using the code below but it won't work. Can someone help me out?
'Calculate "YouSavePercent"
If Product_ListPrice > 0 Then
Product_YouSavePercent = ((1 - (Product_LowestPrice / Product_ListPrice) * 100)
End If
I am building a database that users will update.
I have a table named "products".
Every product has a shelf life of 3 years and expires exactely at the end of the 3rd year.
Here is my table:
Productid ---- int
productName ---- varchar
manufacture_date ----- datetime default (getdate)
Expire_date ----- datetime
What I want is this, whenever a product is entered, the defualt date is the date the entry
was made. (I am using the "getdate") to automatically grab this.
BUT I also want the "Expire_date" field automatically calculated and then filled in.
That is, a user enters a product "manufacture_date" as 05/22/2003,
Then I want the expire field to be filled with 05/22/2006.
My preference is to handle this on the DB site and not ASP.
How to take values from a query and add them together to get totals.The current setup I have:
User selects home they want and clicks on link that passes variable (model home #) that takes them to page 2.
Value in query string is taken and used to bring information about home such as base price amongst other things.
What I would like to do is start with home base price and then call upon options stored in database(each option has their own price)and user can go down a list and select the options(via checkboxes)they want and then at bottom they have a total button that totals base price of home and each option they chose.
if it's possible to do what follows:
i'm getting from querystring *, /, - or + like ...&calculate=* now i want to use this in the calculation like var1 calculate var2 . how do i get it to understand that it's not a string but an actual calculation?
I have a table named tblsheets (access 2000), There are 4 fields I'm concerned about.
Size, Material Grade, Module and Weight.
I wanted to be able to give the user the ability to calculate the
sum of weight according to a specific material grade and specific size in a specific module.
How would I go about creating an asp script that will allow me to do so?
There has to be an option in which the user can select from a combo box the module, and then select material grade and size, also from a combobox if possible (getting the data from tblsheets).
I have a problem to calculate the day different. I use
datediff(currentdate, quoteDate) > 20
The error message is : Wrong number of arguments or invalid property
assignment: 'datediff'
I use datediff("D", Date, quoteDate) > 20, but still could get the correct one. Maybe I need to change string to the digit. How to do it?
need to do a simple form calculation in asp based on values in 2 other field and enter that data into table.
(field)SubTotal + (field)VAT = (Result in field)GrandTotal
I have been asked to create an ASP page that calculates a variety of tariffs,i currently have a an excel document which allows users to input the data and then when pressing the auto sum the other spreadsheets update.
Is there away of linking an asp page to the excel document to input the user data, and then to display the results on the next page?
I need to display 3 fields with future dates (Fridays only) as table
column headers.
i.e. 16th Feb | 23rd Feb | 2nd March.
As each week passes, i.e. from the Saturday, the dates should move
accross 1, i.e. column 1 will update to 23rd Feb, Column 2 to 2nd
March and Column 3 to 9th March.
23rd Feb | 2nd March. | 9th March
I need this to work in IE & Firefox specifically.
Please can you help me work this out ?
I am trying to calculate (in minutes) the difference between two times. In the database the times are in this format:
Start Time (Game_Time): 1/1/1900 12:00:00 PM
End Time (GameEndTime): 1/1/1900 1:00:00 PM
Here is the code I'm trying:
Code:
GameLength = DateDiff("n",Game_Time,GameEndTime)
The result is: 780
I would expect it to be: 60 minutes
What am I doing wrong?
Well my goal is simple. On my site we show "You save: $**.**" but I want that to say "You save: $**.** (**%)."
The database for our store stores the list price, and our price. The store calculates the you save price... so it should be easy to calculate the saved percentage as well. Here's the code that calculates up the "You save" currently on our website: Code: