473,396 Members | 1,833 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Image manipulation in js

I dont know, and i dont much like javascript, however, i am told that
the only way to do want i want to do, is with javascript, so here goes.

zoom and cut is the only features i need.

1. the image that need manipulating is places on the server. dont need
js for that ;-)
2. the client has the oppotunity to manipulate the image. cut and zoom.
3. the image i saved on the server.

It sound realy simple, but than again, i know nothing of js ;-)

Hope to get the help i need.
Regards

Jun 11 '06 #1
9 3328

za******@gmail.com wrote:
I dont know, and i dont much like javascript, however, i am told that
the only way to do want i want to do, is with javascript, so here goes.

zoom and cut is the only features i need.

1. the image that need manipulating is places on the server. dont need
js for that ;-)
2. the client has the oppotunity to manipulate the image. cut and zoom.
3. the image i saved on the server.

It sound realy simple, but than again, i know nothing of js ;-)

Hope to get the help i need.


Not sure if I understand what you mean? Are you talking about a web
page which lets you zoom into an area of a photograph and then crop it
to size?

The problem with this is that as far as I know, you can't do image
manipulation like this in javascript - it simply doesn't have the right
commands to do it. What you could do is this:

- have the server generate a page with an image embedded in it.
- use javascript to zoom into the image using it's height and width
properties. I.e. you don't manipulate the image itself, just change the
way it's displayed so it /looks/ like it's been cropped or zoomed.
- then send back to the server the details of what you want doing to
it.
- then the server does the actual image manipulation using a server
side scripting language like perl or php and a graphics toolkit like
ImageMagick.

I.e. you use javascript to give the illusion of having really cropped
the image, but the actual work of doing this is done on the server.

hope this helps,

andy baxter

Jun 11 '06 #2
za******@gmail.com wrote:
I dont know, and i dont much like javascript, however, i am told that
the only way to do want i want to do, is with javascript, so here goes.

zoom and cut is the only features i need.

1. the image that need manipulating is places on the server. dont need
js for that ;-)
2. the client has the oppotunity to manipulate the image. cut and zoom.
3. the image i saved on the server.

It sound realy simple, but than again, i know nothing of js ;-)

Hope to get the help i need.
Regards


Hello,

If your project is for intranet and if you can control the
browser people are using, you may have a look at the new
"canvas" element. This is a WHATWG specification
[http://www.whatwg.org/specs/web-apps.../#scs-dynamic]

And it is supported by Firefox / Safari / Opera : all modern
browsers except IE.

This element enabled you to draw with javascript : Cut /
rotate / move an image and save it as PNG : (with the
toDataURL() method)

You can find some help here
:[http://developer.mozilla.org/en/docs...s_with_Canvas]
Just forget it if your audience is the whole Web : It's
always a bad thing the restrict accessibility of a web site.

Raphael
Jun 11 '06 #3

Raphael Jolivet wrote:
za******@gmail.com wrote:
I dont know, and i dont much like javascript, however, i am told that
the only way to do want i want to do, is with javascript, so here goes.

zoom and cut is the only features i need.

1. the image that need manipulating is places on the server. dont need
js for that ;-)
2. the client has the oppotunity to manipulate the image. cut and zoom.
3. the image i saved on the server.

It sound realy simple, but than again, i know nothing of js ;-)


This may help you
http://dhtmlgoodies.com/index.html?w...ipt=image-crop

Chris

Jun 11 '06 #4
> zoom and cut is the only features i need.

Zooming:
Just set its width and/or height attribute of image.
<img src="??" width="500" height="200" />

Cropping:
Use a DIV and IMG.
<div style="position:relative;width:[width]px;height:[height]px;">
<img src="??" style="position:relative;top:-[top offset]px;
left:-[left offset]px" />
</div>

Hope this helps,
the DtTvB

Jun 11 '06 #5

lo*****@fastmail.fm skrev:
za******@gmail.com wrote:
I dont know, and i dont much like javascript, however, i am told that
the only way to do want i want to do, is with javascript, so here goes.

zoom and cut is the only features i need.

1. the image that need manipulating is places on the server. dont need
js for that ;-)
2. the client has the oppotunity to manipulate the image. cut and zoom.
3. the image i saved on the server.

It sound realy simple, but than again, i know nothing of js ;-)

Hope to get the help i need.
Not sure if I understand what you mean? Are you talking about a web
page which lets you zoom into an area of a photograph and then crop it
to size?


I think you got it right, but maybe i shoud outline the part of my
project, this is all about.
Avatar pictures is what its all about, the must have a fixed size of
150*200px.
Often people upload pictures that are this size, or do not contrain
proportions and the last issue it the real problem, i want to give the
client a tool to make do something about it.
I for one know how enoying it is having a picture you want to use, but
cant because its not the right size, this way i dont have to install
software and stuff to fix it, but you can do via your browser.
Serverside/Clientside, doesnt matter as long as it works in all the
popular browser: ie, ns, ff, etc.
The problem with this is that as far as I know, you can't do image
manipulation like this in javascript - it simply doesn't have the right
commands to do it. What you could do is this:

- have the server generate a page with an image embedded in it.
- use javascript to zoom into the image using it's height and width
properties. I.e. you don't manipulate the image itself, just change the
way it's displayed so it /looks/ like it's been cropped or zoomed.
- then send back to the server the details of what you want doing to
it.
- then the server does the actual image manipulation using a server
side scripting language like perl or php and a graphics toolkit like
ImageMagick.
I originally wanted it to be server side, but was told that it would be
too demanding or that it simply wasnt posible.
I.e. you use javascript to give the illusion of having really cropped
the image, but the actual work of doing this is done on the server.

Just to make sure we understand eachother.
When all is done i have an image the size of 150*200 lying on the
server, no ilusions here ;-)
hope this helps,

andy baxter


Jun 11 '06 #6
za******@gmail.com said the following on 6/11/2006 2:18 PM:

<snip>
Just to make sure we understand eachother.
When all is done i have an image the size of 150*200 lying on the
server, no ilusions here ;-)


What you need is software for the server that can crop the image for
you. Or, that can resize it. Either crop it or resize it (or both),
display them both to the user, let them pick which one they want with
the third option to resize it themselves.

In any event, the server is the best place for it to happen.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 11 '06 #7

za******@gmail.com wrote:
lo*****@fastmail.fm skrev:
this is that as far as I know, you can't do image
manipulation like this in javascript - it simply doesn't have the right
commands to do it. What you could do is this:

- have the server generate a page with an image embedded in it.
- use javascript to zoom into the image using it's height and width
properties. I.e. you don't manipulate the image itself, just change the
way it's displayed so it /looks/ like it's been cropped or zoomed.
- then send back to the server the details of what you want doing to
it.
- then the server does the actual image manipulation using a server
side scripting language like perl or php and a graphics toolkit like
ImageMagick.

I originally wanted it to be server side, but was told that it would be
too demanding or that it simply wasnt posible.


Have a look at ImageMagick - there's a perl api for this which works OK
(Image::Magick). Whether it's possible depends on who's running your
server I guess.
I.e. you use javascript to give the illusion of having really cropped
the image, but the actual work of doing this is done on the server.


Just to make sure we understand eachother.
When all is done i have an image the size of 150*200 lying on the
server, no ilusions here ;-)


Yes - you use client side scripting to display a cropped, resized image
in a box on the screen, but you're only doing this by manipulating the
stylesheet parameters, not actually cropping the image. Then you send
the parameters back to the server for it to do the real crop/resize
there.

Jun 11 '06 #8

lo*****@fastmail.fm wrote:
za******@gmail.com wrote:
lo*****@fastmail.fm skrev:
this is that as far as I know, you can't do image
manipulation like this in javascript - it simply doesn't have the right
commands to do it. What you could do is this:

- have the server generate a page with an image embedded in it.
- use javascript to zoom into the image using it's height and width
properties. I.e. you don't manipulate the image itself, just change the
way it's displayed so it /looks/ like it's been cropped or zoomed.
- then send back to the server the details of what you want doing to
it.
- then the server does the actual image manipulation using a server
side scripting language like perl or php and a graphics toolkit like
ImageMagick.

I originally wanted it to be server side, but was told that it would be
too demanding or that it simply wasnt posible.


Have a look at ImageMagick - there's a perl api for this which works OK
(Image::Magick). Whether it's possible depends on who's running your
server I guess.
I.e. you use javascript to give the illusion of having really cropped
the image, but the actual work of doing this is done on the server.


Just to make sure we understand eachother.
When all is done i have an image the size of 150*200 lying on the
server, no ilusions here ;-)


Yes - you use client side scripting to display a cropped, resized image
in a box on the screen, but you're only doing this by manipulating the
stylesheet parameters, not actually cropping the image. Then you send
the parameters back to the server for it to do the real crop/resize
there.


I was thinking, if you can't do stuff on the server because of
performance issues, you might be able to do it in a java (not
javascript) applet on the page, and use your client's cpu to do the
image rendering. This would be a lot of work though.

Jun 11 '06 #9

lo*****@fastmail.fm skrev:
lo*****@fastmail.fm wrote:
za******@gmail.com wrote:
lo*****@fastmail.fm skrev:

> this is that as far as I know, you can't do image
> manipulation like this in javascript - it simply doesn't have the right
> commands to do it. What you could do is this:
>
> - have the server generate a page with an image embedded in it.
> - use javascript to zoom into the image using it's height and width
> properties. I.e. you don't manipulate the image itself, just change the
> way it's displayed so it /looks/ like it's been cropped or zoomed.
> - then send back to the server the details of what you want doing to
> it.
> - then the server does the actual image manipulation using a server
> side scripting language like perl or php and a graphics toolkit like
> ImageMagick.
>
I originally wanted it to be server side, but was told that it would be
too demanding or that it simply wasnt posible.


Have a look at ImageMagick - there's a perl api for this which works OK
(Image::Magick). Whether it's possible depends on who's running your
server I guess.
> I.e. you use javascript to give the illusion of having really cropped
> the image, but the actual work of doing this is done on the server.
>

Just to make sure we understand eachother.
When all is done i have an image the size of 150*200 lying on the
server, no ilusions here ;-)


Yes - you use client side scripting to display a cropped, resized image
in a box on the screen, but you're only doing this by manipulating the
stylesheet parameters, not actually cropping the image. Then you send
the parameters back to the server for it to do the real crop/resize
there.


I was thinking, if you can't do stuff on the server because of
performance issues, you might be able to do it in a java (not
javascript) applet on the page, and use your client's cpu to do the
image rendering. This would be a lot of work though.


Client Java? no, no and no again...
Not that it isnt a good idea, but i have often experienced enouing
stuff with jave. either you havent installed it or it needs update,
etc. and it is important for me to spare the users on my site for this.

Jun 12 '06 #10

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

Similar topics

4
by: Rune Johansen | last post by:
Hi. I'm doing some image manipulation in an applet using the example code on this page: http://www.akop.org/art/pixels3.htm However, I really want an application rather than an applet, I just...
6
by: Giggle Girl | last post by:
Overall Background: I am in charge of migrating an already-made Content Mangement System from ASP to PHP. I do not know PHP -- yet! I am trying to foresee potential issues, and here is one. ...
2
by: | last post by:
Hello All, I am writing a web application that reads a bitmap from a file and outputing it to a HTTP response stream to return the image to the requesting client. The image file is a regular...
9
by: Job | last post by:
Hi, I would like to find out what ASP/ASP.net can do with image manipulation. Does ASP have built in functions (eg. after upload to server) to manipulate images, like rotate, scale, crop etc.?...
10
by: Pulzar | last post by:
Hi there, I want to show a simple image on a web page, and allow the viewer to select and change one of the colours used in the image, and immediately preview the result. I'd like to keep the...
3
by: jon | last post by:
Hello, I've had long standing code that runs in IE, that I'm testing with firefox unsuccessfully now. The problem seems to be that images that I dynamically create don't fire their onload event...
8
by: shotokan99 | last post by:
i have this situation. i have a query string: http://www.myquerystring.com?x=xxxxx what this url does is it will return or start downloading a .png file. what i wanted to do is trap this png...
12
by: laredotornado | last post by:
Hi, I'm using PHP 5. I was wondering given an image, a.jpg, how can I make an image that would look like you slid a white index card (which I have a file, white.jpg with the same dimensions as...
5
by: Jumping Arne | last post by:
I'm going to try to write some imange manipulation code (scaling, reading EXIF and IPTC info) and just want to ask if PIL is *THE* library to use? I looked at...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.