Gallery MX
MXMANIA Gallery MX FOR DREAMWEAVER
Free Applications
Album MX Basic
Calendar MX Basic
Asp Upload-Resize...
Private Messaging
User Tracking
Mail Multiple Users
Batch Update/ Delete
File Upload Manager
MXMANIA FILE UPLOAD MANAGER FOR DREAMWEAVER
 
Newsletter MX
MXMANIA NEWSLETTER MX FOR DREAMWEAVER
Resize Images more than Once with Smart Image Processor extension from Dmxzone.com

Ok here we go; this is more a tip than tutorial.

  • Back up your page where you run the script.
  • Back up the file incResizeAddOn.asp
  • Open the file incResizeAddOn.asp and save it as incResizeAddOn1.asp, so you should have now the two files incResizeAddOn.asp & incResizeAddOn1.asp in your "ScriptLibrary" folder
  • Now the game begins:
    Open the file incResizeAddOn1.asp which you made earlier in Dreamweaver and go to Menu
    EDIT > Find and Replace


FIG 1

  • In the Find : write RUF and in the Replace: write RUF1, it should look like this:


FIG 2

  • Now click “Replace All”,
    congratulations we are done with the first part.
  • Now in your page where you run the script add another include:

<!--#include file="ScriptLibrary/incResizeAddOn1.asp" -->

You should now have both "includes":

<!--#include file="ScriptLibrary/incResizeAddOn1.asp" -->
<!--#include file="ScriptLibrary/incResizeAddOn.asp" -->

Very important: The
<!--#include file="ScriptLibrary/incResizeAddOn1.asp" -->

Should be above
<!--#include file="ScriptLibrary/incResizeAddOn.asp" -->

Congratulations, we are done with the 2nd part

  • Now again on the page where the script runs, consider the smart image processor code. I will not write the whole code as it might offend the maker of the extension, which is quite understandable:


FIG 3

  • Copy the whole code, open a new page and paste it there. Again go to Menu “EDIT > Find and Replace” (as shown in FIG 1 )

i.e:

  • In the Find : write RUF and in the Replace: write RUF1 (refer to FIG2), the code shoud look like this:


FIG 4

  • Now copy the whole modified code from the new page and place it write below the Smart Processor code on your page where you run the script. Your page should look some what like this:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="ScriptLibrary/incResizeAddOn1.asp" -->
<!--#include file="ScriptLibrary/incResizeAddOn.asp" -->

.<%
' *** Smart Image Processor 1.1.2

If (CStr(Request.QueryString("GP_upload")) <> "") Then
Dim RUF_Component, RUF_DotNetResize, RUF_ResizeImages, RUF_AspectImages,…

.

.

.

end if
if RUF_RedirectURL <> "" then
Response.Redirect RUF_RedirectURL
end if
end if
%>

<%
' *** Smart Image Processor 1.1.2

If (CStr(Request.QueryString("GP_upload")) <> "") Then
Dim RUF1_Component, RUF1_DotNetResize, RUF1_ResizeImages, RUF1_AspectImages,...
.

.

.

if RUF1_RedirectURL <> "" then
Response.Redirect RUF1_RedirectURL
end if
end if
%>

The only difference at this point between the two code snippets is the variable RUF and RUF1.

Now comes the Final and important step:

  • In both code snippets find the following variables and make changes as stated:
  • RUF_ResizeImages = false
    RUF1_ResizeImages = false
  • RUF_MakeThumb = true
    RUF1_MakeThumb = true
  • RUF_Suffix = "_small"
    RUF1_Suffix = "_resized"

You can name them whatever you prefer, but here “_small” is for Thumbnail and "_resized" is for resized PIC.

  • RUF_maxWidthThumb = "103" (Thumbnail size)
    RUF1_maxWidthThumb = "300" (resized picture size)

Again you can set the width as you wish

In this tutorial I am setting the variables

RUF_AspectThumb = true & RUF1_AspectThumb = true to preserve the aspect ratio.

You can set them as you prefer but remember all the RUF variable values are for thumbnail and RUF1 variable values are for Resized PIC.

Great now what if you want to resize images once more?

Pretty simple repeat the above procedure again, so that you have now another Resize code snippet with variable RUF2 as shown below and the file "incResizeAddOn2.asp" which is made in the same way we did for incResizeAddOn1.asp.


Please note the value:
RUF2_ResizeImages = false


Again the includes should be in this order for Script to work properly. Usually the order in which the icludes are included should be such that the smaller the resize size is the later it should appear e.g. in our case:

<!--#include file="ScriptLibrary/incResizeAddOn1.asp" -->
<!--#include file="ScriptLibrary/incResizeAddOn2.asp" -->
<!--#include file="ScriptLibrary/incResizeAddOn.asp" -->



So in short you upload the PIC, it is resized thrice. You end up with 4 Pics (original, 2 resized and thumbnail or 1 resized and 2 Thumbnails).

I leave all other variable values to you.

Hope you find this useful, if you have any Question or problems with the Tutorial, post it in the Mxmania Forum (TIPS Section) .

Best of Luck

 

 

Album MX Pro
MXMANIA ALBUM PRO FOR DREAMWEAVER
Useful Tutorials
Bandwidth Redirect
Extra session variables
Insert in2 Multiple Table
Regional Date Format
Form Validation
Update multiple records
Nested repeats
Extending Dreamweaver
Intro to SSI
Database Driven Menu
Calendar MX Pro
MXMANIA CALENDAR MX PROFESSIONAL FOR DREAMWEAVER