Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Very easy way to crop and resize image with html

Posted on 2014-12-17
7
Medium Priority
?
94 Views
Last Modified: 2016-05-20
We have a over 500 staff members that we want to add there photos to AD so it will show up on Outlook emails.

But we want the users to crop and resize there own photos that they pick. The crop size MOST be 96x96 and the file MOST be less then 10k is size and MUST be in jpg format.

Anyone have a stupid easy php or jquery that will do this.

1. user pick there own photo.
2. user can resize photo and have a max crop size of 96x96
3. The saved photo must be less then 10k size and in JPG format.
4. The saved file must be the user AD username.

the file name can be gotten from this

$user_login = substr($_SERVER['LOGON_USER'], strrpos($_SERVER['LOGON_USER'],'\\')+1, strlen($_SERVER['LOGON_USER'])-strrpos($_SERVER['LOGON_USER'],'\\'));

Open in new window

0
Comment
Question by:armasmike
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 2000 total points
ID: 40504928
0
 
LVL 58

Expert Comment

by:Gary
ID: 40505037
What you want to do is not easy, the first plugin is as easy as it gets.
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:armasmike
ID: 40505043
I download the zip file but how do i set it up. Like the demo page and from there i can change things. I do like the options like maxsize and stuff
0
 
LVL 58

Assisted Solution

by:Gary
Gary earned 2000 total points
ID: 40505100
Create a folder in your webroot named crop

Copy the src folder from the zip to the crop folder

In the crop folder create another folder named uploads and make sure it has full write permissions


In the crop folder create a file named crop.php and add this code to it.
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> 
<script src="//code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script>
              
<script src="src/jquery.picture.cut.js"></script>   
<style>
.ui-dialog {
top:50px !important
}
</style>
</head>
<body>
<div id="container_image"></div>     


<script>
              $("#container_image").PictureCut({
                  InputOfImageDirectory       : "image",
                  PluginFolderOnServer        : "/crop",
                  FolderOnServer              : "/crop/uploads/",
                  EnableCrop                  : true,
                  CropWindowStyle             : "Bootstrap"
              });
</script>
</body>
</html>

Open in new window


Use the parameters here to set your sizes etc
http://picturecut.tuyoshi.com.br/docs/#Installation
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 40506018
At thecenter intersection of the Venn diagram of "easy," "good," and "free" there is a pink unicorn.  Don't feel bad if you've never seen it -- neither have I.

My recommendation about this task:  Be realistic about how often it will be repeated.  After the first process, there will be a few dozen or so each year, at most.  That's not worth automating.  Instead, get an intern and have the intern do it all by hand, meticulously documenting the process.  Then when the intern is gone, you can give the task to the next intern, who can follow the first intern's documentation.  The alternatives are really costly and time-consuming, requiring a thorough knowledge of image processing.  An intern with basic Photoshop skills and a willingness to learn "actions" can run through an assignment like this in a couple of weeks and all you'll have to buy is coffee!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

636 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