473,769 Members | 6,248 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3377

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*****@fastmai l.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.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 11 '06 #7

za******@gmail. com wrote:
lo*****@fastmai l.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*****@fastmai l.fm wrote:
za******@gmail. com wrote:
lo*****@fastmai l.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*****@fastmai l.fm skrev:
lo*****@fastmai l.fm wrote:
za******@gmail. com wrote:
lo*****@fastmai l.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
5442
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 can't figure out how to do the image loading and manipulation when it's not from inside an applet. Any hints on the subject are appreciated.
6
1780
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. Image Specific Background: The ASP version of the CMS uses a 3rd party component to accept the uploading of images, and then to resize them so that thumbnails are made (as well as the original image) for photo albums.
2
9897
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 bitmap file (filename.bmp) I am experiencing some difficulties with writing a bitmap to a http response stream. I load the bitmap from a file. and i use the following snippet of code to write to HTTP response stream
9
2151
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.? Or are 3rd party solutions needed to do this? I am a php/codfusion programmer and know nothing about asp, so I'm hoping somebody here can help me out.
10
3490
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 image processing away from the server to make the colour selection/preview process quicker, and I also don't want to pre-generate all possible images as there are too many colours that can be selected. Does JS (or any JS libraries) provide image...
3
26760
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 in firefox. The onload method I assign is never being called. Any ideas why firefox isn't calling this, or what I can do for a workaround? Below is approxiatemate code of what I'm doing...
8
2013
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 file and manipuate the image like resizing, color...etc. how can i do this?
12
2968
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 a.jpg) over a.jpg? Note that you'd be sliding the image from top to bottom or from left to right, but not both. Thanks, let me know if this makes sense ... it's a litlte hard to describe.
5
1174
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 <http://www.pythonware.com/products/pil/and noticed that the latest version is from Dec 2006. In my experience that means that either it's abandoned or that it's very good and stable.
0
9423
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,...
1
9996
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
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...
0
6674
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
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
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.