Thanks again for your quick assistance, Paul (I'll definitely remember that..). However, either I missed something, or the resize function does not quite work... I uploaded your package, cleared my cache, and the Upload Size dropdown does appear, but does not seem to have any effect. For example I set it to 100x180, and successfully uploaded an image (of 500x300px) which does not seem to get auto-resized... Did I miss something? Does it work for you ? Can you double check ? Thanks again !.
[Sorry, the form was somehow sent before I could finish my post/suggestion] .. Would be to be able to choose the CSS style for the image. Either a textbox field, or even better a dropdown box with the CSS styles which can apply to the image (those on the XML file, as per the STYLE dropdown box already on the default install). This would make it easier to select an image and apply a style, all in one go (all in your ImageManager window). Not sure if I make any sense. Just a kind suggestion for next update ! (PayPal!) Thanks. Christophe
If someone is interested in the resizing code. It's for ASP.net 2.0 and above. It renders thumbnails on the fly, but it can be modified to save thumbs on to disk:
<%@ Import Namespace=System.Drawing %>
<%@ Import Namespace=System.Drawing.Imaging %>
<%@ Import Namespace=System %>
<%@ Import Namespace=System.Web %>
<script language="VB" runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
Dim originalimg, thumb As System.Drawing.Image
Dim FileName As String
Dim inp As New IntPtr()
Dim width, height As Integer
Dim rootpath, is_error As String
is_error = 0
rootpath = Server.MapPath("/") ' Get Root Application Folder
FileName = rootpath & Request.QueryString("f") ' Root Folder + filename
Try
originalimg = originalimg.FromFile(FileName) ' Fetch User Filename
Catch
originalimg = originalimg.FromFile(rootpath & "/images/image.png") ' Fetch close.gif
is_error = 1
End Try
' Get width using QueryString.
If Request.QueryString("width") = Nothing Then
' Use original Width.
If is_error = 1 then
width = originalimg.Width
else
width = 100
end if
ElseIf Request.QueryString("width") = 0 Then ' Assign default width of 100.
width = 100
Else
width = Request.QueryString("width") ' Use User Specified width.
End If
' Get height using QueryString.
If Request.QueryString("height") = Nothing Then
If is_error = 1 then
height = originalimg.Height
else
height = 75
end if
ElseIf Request.QueryString("height") = 0 Then ' Assign default height of 100.
height = 75
Else
height = Request.QueryString("height") ' Use User Specified height.
End If
thumb = originalimg.GetThumbnailImage(width, height, Nothing, inp)
' Sending Response JPEG type to the browser.
Response.ContentType = "image/jpeg"
thumb.Save(Response.OutputStream, Imaging.ImageFormat.Jpeg)
' Disposing the objects.
originalimg.Dispose()
thumb.Dispose()
End Sub
</script>
RE: Plugin ImageManager: auto resize uploaded
http://www.saulmade.nl/FCKeditor/FCKPlugins.php
http://sourceforge.net/tracker/index.ph ... tid=737639
RE: Plugin ImageManager: auto resize uploaded pic
RE: Plugin ImageManager: auto resize uploaded
RE: Plugin ImageManager: auto resize uploaded pic
RE: Plugin ImageManager: auto resize uploaded pic
.. Would be to be able to choose the CSS style for the image. Either a textbox field, or even better a dropdown box with the CSS styles which can apply to the image (those on the XML file, as per the STYLE dropdown box already on the default install). This would make it easier to select an image and apply a style, all in one go (all in your ImageManager window). Not sure if I make any sense. Just a kind suggestion for next update ! (PayPal!)
Thanks.
Christophe
RE: Plugin ImageManager: auto resize uploaded
Is the default styles dropdown list not working for this?
Re: Plugin ImageManager: auto resize uploaded pic
Re: Plugin ImageManager: auto resize uploaded pic
Re: Plugin ImageManager: auto resize uploaded pic
It renders thumbnails on the fly, but it can be modified to save thumbs on to disk:
<%@ Import Namespace=System.Drawing %> <%@ Import Namespace=System.Drawing.Imaging %> <%@ Import Namespace=System %> <%@ Import Namespace=System.Web %> <script language="VB" runat="server"> Sub Page_Load(Sender As Object, E As EventArgs) Dim originalimg, thumb As System.Drawing.Image Dim FileName As String Dim inp As New IntPtr() Dim width, height As Integer Dim rootpath, is_error As String is_error = 0 rootpath = Server.MapPath("/") ' Get Root Application Folder FileName = rootpath & Request.QueryString("f") ' Root Folder + filename Try originalimg = originalimg.FromFile(FileName) ' Fetch User Filename Catch originalimg = originalimg.FromFile(rootpath & "/images/image.png") ' Fetch close.gif is_error = 1 End Try ' Get width using QueryString. If Request.QueryString("width") = Nothing Then ' Use original Width. If is_error = 1 then width = originalimg.Width else width = 100 end if ElseIf Request.QueryString("width") = 0 Then ' Assign default width of 100. width = 100 Else width = Request.QueryString("width") ' Use User Specified width. End If ' Get height using QueryString. If Request.QueryString("height") = Nothing Then If is_error = 1 then height = originalimg.Height else height = 75 end if ElseIf Request.QueryString("height") = 0 Then ' Assign default height of 100. height = 75 Else height = Request.QueryString("height") ' Use User Specified height. End If thumb = originalimg.GetThumbnailImage(width, height, Nothing, inp) ' Sending Response JPEG type to the browser. Response.ContentType = "image/jpeg" thumb.Save(Response.OutputStream, Imaging.ImageFormat.Jpeg) ' Disposing the objects. originalimg.Dispose() thumb.Dispose() End Sub </script>