Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

copy and paste images within a php driven application

Posted on 2005-05-13
15
Medium Priority
?
290 Views
Last Modified: 2010-08-05
hello

I need advices to improve the user side performaces of a php driven web application developped with php 4.x/Apache/Oracle/Linux. App is used in 100MB LAN

Here is the current scenario.

* Clients are powerful Windows XP boxes with IE6x
* We re inserting jpg images to the app database by attaching pjg files.
* images are coming from a graphic design application. in order to attach a file users has to:
    . copy the image are within the graph app.
    . paste the image to the new document within  the same graphic app.
    . resize the image to lower resolution
    . save as jpg.
    . go to the above said application find and attach the jpg file
    . and submit
* The whole process takes 3 to 4 mins for a trained user.

User are repeating these operations very ofthen, it s time taking and stressing.

What would be the best solution we can implement within the application on server to ease the life of the users.

As fas as my knowledge goes we can copy images and paste to java applet.

What I d need is ;
 . copy the image to an area within the web app in IE6.
 . the solution would rescale the image to a given resolution before parsing data
 . and user clicks submit.

This is what comes to my mind as a non-coder.

Would the applet start fast enough within IE so that users can paste within an area the copied image ??

Can you please give me some indications about the best solution I can ask the developpers to code. ?

I know there are even open source applets that might fit to purpose if java applet is the best solution. Can you give me some indication to the locations please ?

I m giving the maximum possible points . Sorry if this is not the right place for this question.

Thanks
0
Comment
Question by:tgunduz
  • 5
  • 3
  • 3
  • +2
13 Comments
 
LVL 5

Expert Comment

by:apparition
ID: 14018912
Your users can just store the images on a location in the LAN. You can then change your PHP web application to automatically resize the image before it is submitted. There is a free plugin software that allows images to be resized. Go to http://www.imagemagick.org/script/index.php
0
 

Author Comment

by:tgunduz
ID: 14021202
hello

yes I have slight knowledge of this open source tool.  I m afraid it does not solve my copy and paste problem

user still has to save as *.imagefiletype then go to the php app to upload.

I need to be able to copy and paste directly to the my web application

any idea ?
thx
0
 
LVL 5

Expert Comment

by:apparition
ID: 14021257
What does your php application do? Does it store the image information into a database. I need to understand what your php app does in order to provide you with the best solution.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:tgunduz
ID: 14022122
pls read once again ...mabe for me it is clear :)

basically ;
its a ERP like app ..we need to store our item's pics agains their specs. the picture should be stored while the items data is being entered...so manipulating the images in in the CAD/CAM design app in order to save as jpg then use in the said app is really time taking...source images are coming from desktop CAD/CAM app and destination is php driven web app...

I was thinking that a copy and paste would be the fastest solution ...but how ?

thx
0
 
LVL 30

Expert Comment

by:GrandSchtroumpf
ID: 14022564
I think you don't get a lot of responses because what you are trying to do is not very clear.

From what i understand, you have a picture in some poprietary format.
And your ERP needs the resized image in the jpg format.

Resizing jpg files can be automated using various programs, but converting the proprietary image to a jpg or other standard format is the problem.

Using copy/paste will probably not help.
When you copy inside an app, the content is copied to the clipboard.
Then, when you paste to another app, it's the content of the clipboard that gets pasted.
So, the copy/paste between the 2 apps will only work if the 2 apps support the same clipboard content.
I doubt your proprietary app will place any standard format image into the clipboard when you do a copy.
0
 
LVL 5

Expert Comment

by:apparition
ID: 14022598
You might consider creating a batch program that reads from directory of images and adds them to your backend system.
We can discuss this in further detail if you are willing to consider this route.
0
 

Author Comment

by:tgunduz
ID: 14022755
thank you all

basically I was expecting to be able to paste images to a java applet within a php driven web app . the most important point is the possibility to past images to this applet. resizing the images and transforming to jpg format is - I think - easier

regs
0
 

Author Comment

by:tgunduz
ID: 14022773
additional info:

I can past images copied from the CAD/CAM to MSPaint . this functions.
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 14026199
Sounds like you are looking for an application into which user can copy paste the image. The application will
- resize it
- store it as a jpg
- upload it

Am I right or is there something else too? If yes, then how does the application know upload location? Is it possible to know/derive it?
There are plenty of free application which can
- resize and convert images and support shell functionality. Your application can invoke it to do the image related processing
- yet another application can be invoked for upload part
If this is possible, you will save substantial development, testing and maintenance effort.

>Would the applet start fast enough within IE so that users can paste within an area the copied image ??
It would take a short while the first time but once JRE is loaded, it should be faster. You say that the machines are high power XP boxes, so I do not think speed will be a big issue for a Java based solution
0
 

Author Comment

by:tgunduz
ID: 14027851
> Sounds like you are looking for an application into which user can copy paste the image. The application will
>- resize it
>- store it as a jpg
>- upload it

> Am I right or is there something else too?

That's correct. The web application is php driven with oracle database. We are actually uploading our images to the database trough the web page. User selects the jpg file he has just manipulated (copied, pasted, resized, saved as..) and validated. The web application uploads and stores to oracle Database.

I m trying to find a solution to save the users time on the  manipulation process (copied, pasted, resized, saved as..). Ideally we shud be able to copy a selected image area from CAD/CAM application to the a webpage with say a java applet can accept image paste operation.

Copy from CAD/CAM application and paste to MSPaint functions.

0
 
LVL 30

Expert Comment

by:GrandSchtroumpf
ID: 14040821
You might be able to do what you want with a java applet.
The applet can:
1.  read the content of the clipboard (binary data).
2.  mime-encode the bytes using the correct mime-type (you'll need use trial/error here).
3.  call a javascript method that writes the mime-encoded image to a hidden form field (make sure your hidden field has the same "name" as the initial <input type="file">).

That's the basic idea, but i'm not sure it will work.
I don't know exactly how the file attachments are posted and if it's equivalent to using an hidden field that contains the mime-encoded data.
0
 
LVL 10

Expert Comment

by:iamanindian
ID: 14053921
GrandSchtroumpf has provided a very good approach. But, I am not too confident about the clipboard reading for image...at least not through JavaScript (javascript allows text & url...but image..I have doubts). Trial-n-error...sure.

Regards
WC
0
 
LVL 30

Accepted Solution

by:
GrandSchtroumpf earned 1000 total points
ID: 14054445
> But, I am not too confident about the clipboard reading for image...at least not through JavaScript (javascript allows text & url...but image..I have doubts).
Well, that's the whole idea behind using a java applet, and not javascript.
But once you have your image in the applet, the problem is to send it with the rest of the data.

You can try submitting the data from your applet (http request from java).
From the applet, you can access the content of your form fields and send all the information you need, including session id or hidden field values.
You can even use the applet to collect the complete user input (image + description).

Note that an applet can call a javascript method and javascript can call an applet's method.
So, with both java and javascript, you should be able to find a way to make it work.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question