Can you recommend a good image manipulation dll for ASP.NET - asp.net

Looking for a library that will allow me to size and resize images using c# and ASP.net on a Windows 2003 Server.

DISCLAIMER: I'm the author.
The free ImageResizing.Net library is precisely what you're looking for.
It's stable, mature (since 2007), actively developed, supported, and... open source.
It is specifically designed to provide image manipulation for ASP.NET, while avoiding all of the GDI bugs. It provides a highly-scalable and efficient manipulation API that often only requires 1 line of code to use. It doesn't leak memory or handles, and has 0 known bugs as of this writing.
If you decide to roll your own solution, PLEASE read this list of pitfalls to avoid. And for those thinking WIC is the solution - it is unsupported for use from ASP.NET.
Site link:
ASP.NET Image Resizing Module for IIS

Another free (Microsoft blessed) alternative is System.Web.Helpers.WebImage. WebImage is part of the ASP.NET Web Pages library.
After installation, the assemblies are located in:
Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies
Example
public void GetResized()
{
new WebImage(ImagePath)
.Resize(200, 200) // resize image to 200x200 px
.Write();
}
Other example usages here.

Just use the built-in classes in the System.Drawing namespace: http://msdn.microsoft.com/en-us/library/system.drawing.image.aspx
Note, as was pointed out in the comment below, the Windows Imaging Components may be a better fit.
Here is a tutorial: http://www.switchonthecode.com/tutorials/csharp-tutorial-image-editing-saving-cropping-and-resizing

I'm currently using Atalasoft Photo (Free) DotImage SDK for basic image manipulation:
http://www.atalasoft.com/products/dotimage/feature-matrix
Works well for my needs and including thumbnail processing & cropping and has tons of image format support which also comes free with the SDK.

Related

Simple image operations for .NET Core 6 and beyond

I have some C# code that relies on doing really basic graphic operations such as getting and setting pixels, and drawing texts over images. This uses the System.Drawing package which Microsoft has dropped the ball on.
Microsoft says this: Migrate to one of the following libraries: ImageSharp, SkiaSharp, Microsoft.Maui.Graphics. The latter appears to be ill-documented and unstable.
Could anyone with experience with these packages suggest an easy and simple way forward?
I am even wondering if it might pay to write my own library for the Windows bitmap format (which is sufficient for my purposes).
Yours frustratingly...
It depends on which platform you are building your app, but SkiaSharp 2.80.2 or 2.80.3 can be a good choice. There are quite a bit problems in newer packages, so you need to be careful which version you install so that you do not run into performance problems or bugs.

Flex/Openlaslzo for RIAs?

I recently stumbled upon flex/openlaszlo (OL). Both seem very useful and I have a few questions about them:
What is needed to deploy flex apps? From what I understand, the flex sdk
is open source, but the other tools
(for development and deployment) are
proprietary.
What is needed to deploy openlaszlo? Is it completely open
source (from development to
deployment), or does it have
development/deployment "gotchas" like
flex?
Specifically, I'd like to use flex or openlaszlo to either augment or
replace an editable table I created
using js, ajax, html, and css. Is this
the type of thing flex/OL can/should
be used for? Are there any drawbacks
or pitfalls to using flex/OL for this
rather than straight js, ajax, html,
css?
Thanks.
Edit: Are there any licensing (use) restrictions on applications built on flex? i.e. applications built on flex can be for only non-commercial use, unless a commercial license is purchased?
The following link has some discussion about openlaszlo and flex, it may help you:
Use the best open source client-side framework for cloud computing
You do not need anything special to deploy Flex apps. Just put the compile app (a SWF file) on any web server. Flex apps can talk to any back-end.
Flex SDK is free, but Flex Builder is not. You can use the free and open source FlashDevelop to write flex apps - it doesn't have drag-n-drop features like flex builder, but it offers code hinting and stuff. I don't know about openlaszlo.
Below is the link providing details of tools/IDEs for developing OpenLazlo applications
http://wiki.openlaszlo.org/Development_Tools
Re: "What is needed to deploy openlaszlo? Is it completely open source (from development to deployment)"
OpenLaszlo is OpenSource, but the typical versions you install come with the main components pre-compiled into a SWF for the SWF run-time. However, you can download the full source code if you wish to look at it and/or compile the core yourself:
Last official released version (4.9.0): http://download.openlaszlo.org/4.9.0/openlaszlo-4.9.0-src.tar.gz
Nightly builds:
http://download.openlaszlo.org/nightly/trunk/ (you will see "source" as an option after you click the link of the version you want)
OpenLaszlo does not require anything else to be deployed but itself, except if your application is compiled to the SWF run-time then the user will need the Adobe Flash player installed in their browser to use it.
I'll answer your last question: the biggest drawback to using Flex is that it requires the client to have the Flash Player plugin installed in their browser. Not that big a deal for most people since Flash Player is over 98% of all computers. With the straight Javascript, AJAX, HTML, CSS approach it should work on all browsers, assuming you wrote it correctly.

Text to Speech in ASP.NET

I would like to do some japanese text to speech on my dedicated windows 2003 x64 server with .net framework, using c#
I found something on google, but requires to install a lot of files on the server... i don't like, for stability issues: there is another option, like a linked dll or something?
You can use Microsoft Speech SDK. It's a set of COM APIs containing TTS and SR engines. I'm not sure if it contains Japanese TTS though.
What you most likely want is the Microsoft Speech Server especially if your webite is going to encounter any decent load or volume.
From the site:
"A speech platform, MSS contains all
the server components for deploying
telephony (voice-only) and multimodal
(voice/visual) applications. MSS
combines Web technologies,
speech-processing services, and
telephony capabilities into a single
system. "
There is also a dedicated Microsft Speech community which will likely help you get started in this realm. Also, I'm not sure what the latest version is...2004 R2?
This article has a decent diagram outlining the various components. Looks like a good fit for integration with an ASP Web Application.
using SAPI in an ASP.NET website, is impossible: the sound will be reproduced on the server :S
It seems that there is the need of Microsoft Speech Server
...
Or not? With asp.net is possible to run a commandline exe on the server to save an mp3, then stream that mp3, right? (how to do that? i will try to figure it)
I will go this way, i let you know the result :)
edit: this is how i solved:
How to save text-to-speech as a wav with Microsoft SAPI?
I save the generated voice in a wav file, then i embed it on the page, playing it in a flash player
COOL!!
Use Microsoft Speech Library and see this article Text to Speech with the Microsoft Speech Library and SDK version 5.1 in CodeProject. Also see Giving Computers a Voice in Coding4Fun
The System.Speech.Synthesis namespace has been part of the framework since .NET 3.0. However, it has internal dependencies on the Speech SDK COM libraries (it chooses the correct version depending on the host OS), so I would recommend prototyping the work before you jump in.
The class you should probably look at first is System.Speech.Synthesis.SpeechSynthesizer (whitepaper and example code)
Warning: I have personally experienced issues using the speech APIs in an ASP.NET environment whereby the request that returned the audio data never returned. Despite heavy debugging I was never able to resolve the issue and the feature was dropped. I have had an unresolved support case with Microsoft for 12 months now.

Profiling existing flash files

I'm trying to do some research on flash objects in browsers. For example memory usage etc.
With Adobe Flex Builder 3 im trying to do some profiling on swf files but the problem is that I can only do this on debug swfs. Almost all adds/games/video are release version. Is there a way to some testing on those?
There's a similar question, posting in here too as it's just as relevant in this thread:
It's important to note that the Flash Player implementation is different on each platform and to an extent each browser, so expect notable speed differences. So if you're developing a resource intensive application you should be using profiling tools specific to each OS you're targeting, like for example Instruments on OS X and of course test the performance in each browser.
I would say you will need to get the source. You could try a decompiler.
Look at the flash.sampler. You will need to run your content in the debugging version of the Flash player, but the content itself doesn't need to have been compiled with debugging symbols.
You can use the PreloadSWF option to inject an agent that can monitor. If you just want memory usage, that's a cheap API to call.

Image manipulation in asp.net/c# without System.Drawing/GDI+

Is there any alternative image manipulation library for .net? I would prefer something that is managed and open source.
I ask this because of two reasons:
I have encountered hard to debug GDI+ errors with System.Drawing in the past
I have read that using System.Drawing in asp.net web applications is not 100% supported.
Thanks!
edit: clarification, I know that System.Drawing can work asp.net web apps - I have used it in the past. I really just wonder if there are any managed image manipulation libraries for .net :)
You should look into the WPF Imaging libraries shipped with .NET 3.0. They're optimized and robust (used to run Aero, so you know they're efficient). They don't depend on the WPF dispatcher, are easily extensible, and officially supported. What more could you want?
I don't know of any fully-managed 2D drawing libraries that are either free or open-source (there appears to be a few commercially available, but OSS is the way to go). However, you might look into the Mono bindings to Cairo.
Cairo is a platform independent 2D drawing API. You can find more information about it at the Cairo homepage. The Cairo Wikipedia page also has some good info.
Cairo is also used fairly widely in the Open Source world, which to me says something about its robustness. Mozilla, Webkit, and Mono all use it, among others. Ironically, Mono actually uses it to back their System.Drawing implementation... go figure.
There might also be a way to use Mono's System.Drawing implementation as a drop-in replacement for the Microsoft implementation, though I'm not sure how or if that would even work. I would probably start by replacing the System.Drawing.dll reference with Mono's version, and then try to deal with any errors.
Anecdotal evidence #1: I have used GDI+ for on-the-fly image creation within ASP.NET with no problems. I'm not sure what the problems would even be.
With respect to (1), most of the hard to debug errors are due to not closing open handles (Dispose() in managed-land). I'm curious where you heard (2).

Resources