Ciao,
vi allego il codice che sto utilizzando per ridimensionare le immagini.
Il problema è che le miniature sono tutte diverse di dimensioni,
c'è un modo per averle tutte della stessa larghezza o altezza?

GRAZIE

Codice PHP:
<%@ Page Language="C#" %>
<%@ 
import Namespace="System.Drawing" %>
<%@ 
import Namespace="System.Drawing.Imaging" %>
<%@ 
import Namespace="System.Text.RegularExpressions" %>
<
script runat="server">

int MaxWidth 100// Minimal width for resize
int MaxHeight 100// Minimal height for resize
int ScaleFactor 10// Scale factor
System.Drawing.Image oldImagenewImage;

void Page_Load(Object senderEventArgs e) {
if ( 
Request.QueryString["FileName"] != null ) {
string strFileName Convert.ToString(Request.QueryString["FileName"]);
if ( 
Request.QueryString["ScaleFactor"] != null && Convert.ToString(Request.QueryString["ScaleFactor"]) != "" && IsInteger(Convert.ToString(Request.QueryString["scalefactor"])) ) ScaleFactor Convert.ToInt32(Request.QueryString["ScaleFactor"]);
if ( 
strFileName != "" ) {
try {
oldImage System.Drawing.Image.FromFileServer.MapPath(strFileName) );
if ( 
oldImage.Width MaxWidth || oldImage.Height MaxHeight ) {
// Immagine troppo grande, visualizzo la miniatura
newImage oldImage.GetThumbnailImage( (oldImage.Width*ScaleFactor/100), (oldImage.Height*ScaleFactor/100), nullIntPtr.Zero);
Response.ContentType "image/jpeg";
newImage.Save(Response.OutputStreamSystem.Drawing.Imaging.ImageFormat.Jpeg);
oldImage.Dispose();
newImage.Dispose();
oldImage null;
newImage null;
} else {
// Immagine piccola, non faccio nulla
Response.ContentType "image/jpeg";
oldImage.Save(Response.OutputStreamSystem.Drawing.Imaging.ImageFormat.Jpeg);
oldImage.Dispose();
oldImage null;
}
} catch (
Exception ex) {
Response.Write(ex.Message);
}
}
}
}

private 
bool IsInteger(string strTmp) {
Regex objNotIntPattern = new Regex("[^0-9-]");
Regex objIntPattern = new Regex("^-[0-9]+$|^[0-9]+$");
return !
objNotIntPattern.IsMatch(strTmp) && objIntPattern.IsMatch(strTmp);
}

</script>