473,699 Members | 2,801 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Resize and Upload Images to SQL Server 2005

Hi

Would anyone be able to offer advice on how they would upload images
to SQL Server 2005 so that if they are too big the system will
automatically resize them first? Obviously you need to get hold of the
image first so do you store them to a temporary location first etc.???
This will be a web app.

Any advice/discussion would be very helpful.

Thanks

Dave

Jun 7 '07 #1
5 2248
When I say "if they are too big", I mean too big by the definition I
set
Jun 7 '07 #2
On Thu, 07 Jun 2007 07:12:47 -0700, bungle <bu****@wizardb uy.comwrote:
Would anyone be able to offer advice on how they would upload images
to SQL Server 2005 so that if they are too big the system will
automatically resize them first? Obviously you need to get hold of the
image first so do you store them to a temporary location first etc.???
This will be a web app.
Define "too big" and "automatically" . Do you want .NET to detect "too
big" and without any intervention on your part, do the resizing? Or do
you simply mean you want to write the code to detect that case and resize
when necessary? If the latter, read on...

I don't know about the "web" and "SQL" aspects of your question. But
resizing the image is easy. Depending on the quality of the resizing you
want, you can just create a new Bitmap instance based on an existing Image
(which in this case would be the original Bitmap), providing a new size.
The image will be scaled for you. If you want better-quality resizing,
you need to create the new Bitmap with the size you want, but then create
a Graphics from the new Bitmap (Graphics.FromI mage()) set the
interpolation mode to whatever value you want (the
Graphics.Interp olationMode property), and then draw the original bitmap
into the new bitmap (Graphics.DrawI mage()).

If you already know how to get the bitmap instance, and you already know
how to save that image to a SQL database, then the above is really all you
need. If you need all that other stuff too, someone else will have to
answer that. :)

Pete
Jun 7 '07 #3
If you store images in varbinary fields, you should not worry about any
resizing and big issues

See samples for BLOB manipulation in SQL Books Online.

HTH
Alex

"Peter Duniho" <Np*********@nn owslpianmk.comw rote in message
news:op******** *******@petes-computer.local. ..
On Thu, 07 Jun 2007 07:12:47 -0700, bungle <bu****@wizardb uy.comwrote:
>Would anyone be able to offer advice on how they would upload images
to SQL Server 2005 so that if they are too big the system will
automaticall y resize them first? Obviously you need to get hold of the
image first so do you store them to a temporary location first etc.???
This will be a web app.

Define "too big" and "automatically" . Do you want .NET to detect "too
big" and without any intervention on your part, do the resizing? Or do
you simply mean you want to write the code to detect that case and resize
when necessary? If the latter, read on...

I don't know about the "web" and "SQL" aspects of your question. But
resizing the image is easy. Depending on the quality of the resizing you
want, you can just create a new Bitmap instance based on an existing Image
(which in this case would be the original Bitmap), providing a new size.
The image will be scaled for you. If you want better-quality resizing,
you need to create the new Bitmap with the size you want, but then create
a Graphics from the new Bitmap (Graphics.FromI mage()) set the
interpolation mode to whatever value you want (the
Graphics.Interp olationMode property), and then draw the original bitmap
into the new bitmap (Graphics.DrawI mage()).

If you already know how to get the bitmap instance, and you already know
how to save that image to a SQL database, then the above is really all you
need. If you need all that other stuff too, someone else will have to
answer that. :)

Pete

Jun 7 '07 #4
On Thu, 07 Jun 2007 11:51:15 -0700, AlexS
<sa***********@ SPAMrogers.comP LEASEwrote:
If you store images in varbinary fields, you should not worry about any
resizing and big issues
I disagree. First of all, clearly the OP is concerned, and his concerns
should not be dismissed without at least trying to understand why he has
them.

Second, a database has to be stored somewhere. The data has to be
transferred somehow. The larger the data is, the more space the database
takes up and the slower it is to move the data around (whether that's to
update the database, return results to a client, or doing maintenance on
the database). Reducing data size is quite often a very legitiate and
very important goal.

Pete
Jun 7 '07 #5
If original concerns are not addressed, most probably original poster will
add some details to clarify the issue.
"Peter Duniho" <Np*********@nn owslpianmk.comw rote in message
news:op******** *******@petes-computer.local. ..
On Thu, 07 Jun 2007 11:51:15 -0700, AlexS
<sa***********@ SPAMrogers.comP LEASEwrote:
>If you store images in varbinary fields, you should not worry about any
resizing and big issues

I disagree. First of all, clearly the OP is concerned, and his concerns
should not be dismissed without at least trying to understand why he has
them.

Second, a database has to be stored somewhere. The data has to be
transferred somehow. The larger the data is, the more space the database
takes up and the slower it is to move the data around (whether that's to
update the database, return results to a client, or doing maintenance on
the database). Reducing data size is quite often a very legitiate and
very important goal.

Pete

Jun 7 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1401
by: vishal | last post by:
how can i upload images to server which are seleceted from a client on his machine. please tell me in detail thxs
6
1832
by: Shawn | last post by:
Hi. I'm letting the users upload images into a sybase 12.5 database. The problem is that when ContentLength exceeds 131 071 an exception occur. The e.Message property is empty so it doesn't tell me much. I know that images much larger than this exist in the database. Any help is appreciated! Here is my code: Dim cn As New Connection Dim oleDbCommand As OleDbCommand Dim strSqlImage As String Dim stream As System.IO.Stream =...
7
3122
by: chad | last post by:
is it just me or does anybody else find the Image.RotateFlip method kind of slow? (I'm comparing to commercial softwares). Same for resizing. I'm using sourceImage = system.drawing.bitmap.fromFile(filestring) newImage = new bitmpa(sourceImage, newWidth, newHeight) newImage.save(newFileString) Anyone knows of any faster methods?
8
6707
by: nick | last post by:
I have only SQL Server 2005 installed on my PC. And I tried to add the following rows in web.config to use SQL Server 2005 instead of Express: <connectionStrings> <clear /> <add name="LocalSqlServer" connectionString="Data Source=.\SQL2005;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;user instance=true;Integrated Security=True;Initial Catalog=ASPNETDB;" providerName="System.Data.SqlClient" /> </connectionStrings>
2
3170
by: Anns via SQLMonster.com | last post by:
I have about 20 Ms Access Databases to need to be upload onto a SQL Server 2005. Currently the are on a network/server residing on a specific drive. The goal is to keep the user face the same (ms access) and put all of the tables onto a SQL Server 2005 BE, and yet make those databases accessible to open/view through Ms Sharepoint. What is the simple (properties) way to grab all of those db's = 20 and upload to server?
2
8191
by: Marcus | last post by:
(Appologies if this group isn't the best place for this post) Is it possible to use DAO 3.6 to access binary data (varbinary(max)) in Sql Server 2005? I have images and sound in a Sql 2005 DB that I need to retrieve (and write) with DAO (ADO and ADO.Net are not options as this is legacy code that can't be changed). Thx, Marcus
1
3827
by: pompair | last post by:
Hi, Could someone give a pointer how to import couple of hundred images into Sql Server 2005 Express Edition database? Is there a tool for it? Can it be done with Sql Management Studio or is it just a matter of writing own piece of software (a little helper app) to do it? -timonardo
0
953
by: DR | last post by:
easiest way to upload a C# class library to a SQL server 2005 and deploy as CLR function Do I have to upload the .dll and then run sql command to load it into sql server, or is there a more integrated way to do this in visual studio 2005 with a SQL Server Project? or do i have to manualu upload the DLL in all cases? Any tutorial on CLR with Visual Studio 2005 IDE to Sql Server 2005?
0
2022
by: poojamangal | last post by:
I want to upload images or pdf files. but i m unable to do so. i got error. please help me to sort it out.. my code is: <% 'on error resume next Class FreeASPUpload Public UploadedFiles Public FormElements Private VarArrayBinRequest
0
8686
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8615
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9033
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7748
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6533
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5872
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3057
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2009
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.