PSD-Tutorials.de
Forum für Design, Fotografie & Bildbearbeitung
Tutkit
Agentur
Hilfe
Kontakt
Start
Forum
Aktuelles
Besonderer Inhalt
Foren durchsuchen
Tutorials
News
Anmelden
Kostenlos registrieren
Aktuelles
Suche
Suche
Nur Titel durchsuchen
Von:
Menü
Anmelden
Kostenlos registrieren
App installieren
Installieren
JavaScript ist deaktiviert. Für eine bessere Darstellung aktiviere bitte JavaScript in deinem Browser, bevor du fortfährst.
Du verwendest einen veralteten Browser. Es ist möglich, dass diese oder andere Websites nicht korrekt angezeigt werden.
Du solltest ein Upgrade durchführen oder einen
alternativen Browser
verwenden.
Antworten auf deine Fragen:
Neues Thema erstellen
Start
Forum
Sonstiges
Webdesign, Webentwicklung & Programmierung
PHP, Javascript, jQuery, Ajax, nodeJS, MySQL...
Image Crop
Beitrag
<blockquote data-quote="brizzi" data-source="post: 2448976" data-attributes="member: 688877"><p>Hallo liebe Community,</p><p></p><p>ich habe ein Javascript Problem. Und zwar wie Ihr schon der Überschrift entnehmen konntet, habe ich ein Problem mit dem Image Jcrop.</p><p>Das Problem ist folgendes, wenn ich ein Bild auf meiner Seite hochlade, wird im Anschluss ein Popup fenster geöffnet, wo ich dann mein gewünschten Bereich des Bildes auswählen kann und Croppen kann.</p><p>Nun ja wenn ich zu diesem Popup gelange wird mir das Bild bei ersten mal gestaucht. Breche ich es ab und versuche es erneut, wird es diesesmal richtig angezeigt. und so ist es durchgehend in Firefox. In Chrom hingegen, wird es dauerhaft gestauch angezeigt. Ich weiß da erhlich gesagt nicht weiter und weiß nicht was ich da gegen tuen soll. Hoffe Ihr könnt mir hier soweit helfen und ihr versteht was ich meine. Zum besseren verständnis werde ich noch nen Link euch geben, damit ihr es euch mal Live anschauen könnt.</p><p></p><p>Hier ist der Link --> </p><p></p><p></p><p>und hier mein JS Code:</p><p></p><p>[code=JavaScript]// the target size</p><p>var TARGET_W = 700;</p><p>var TARGET_H = 450;</p><p></p><p>// show loader while uploading photo</p><p>function submit_photo() {</p><p> // display the loading texte</p><p> $('#loading_progress').html('<img src="images/loader.gif"> Uploading your photo...');</p><p>}</p><p></p><p>// show_popup : show the popup</p><p>function show_popup(id) {</p><p> // show the popup</p><p> $('#'+id).show();</p><p>}</p><p></p><p>// close_popup : close the popup</p><p>function close_popup(id) {</p><p> // hide the popup</p><p> $('#'+id).hide();</p><p>}</p><p></p><p>// show_popup_crop : show the crop popup</p><p>function show_popup_crop(url) {</p><p> // change the photo source</p><p> $('#cropbox').attr('src', url);</p><p> </p><p> // destroy the Jcrop object to create a new one</p><p> try {</p><p> jcrop_api.destroy();</p><p> } catch (e) {</p><p> // object not defined</p><p> }</p><p> // Initialize the Jcrop using the TARGET_W and TARGET_H that initialized before</p><p> $('#cropbox').Jcrop({</p><p> aspectRatio: TARGET_W / TARGET_H,</p><p> setSelect: [ 100, 100, TARGET_W, TARGET_H ],</p><p> onSelect: updateCoords</p><p> },function(){</p><p> jcrop_api = this;</p><p> });</p><p></p><p> // store the current uploaded photo url in a hidden input to use it later</p><p> $('#photo_url').val(url);</p><p> // hide and reset the upload popup</p><p> $('#popup_upload').hide();</p><p> $('#loading_progress').html('');</p><p> $('#photo').val('');</p><p></p><p> // show the crop popup</p><p> $('#popup_crop').show();</p><p>}</p><p></p><p>// crop_photo :</p><p>function crop_photo() {</p><p> var x_ = $('#x').val();</p><p> var y_ = $('#y').val();</p><p> var w_ = $('#w').val();</p><p> var h_ = $('#h').val();</p><p> var photo_url_ = $('#photo_url').val();</p><p></p><p> // hide thecrop popup</p><p> $('#popup_crop').hide();</p><p></p><p> // display the loading texte</p><p> $('#photo_container').html('<img src="images/loader.gif"> Processing...');</p><p> // crop photo with a php file using ajax call</p><p> $.ajax({</p><p> url: 'crop_photo.php',</p><p> type: 'POST',</p><p> data: {x:x_, y:y_, w:w_, h:h_, photo_url:photo_url_, targ_w:TARGET_W, targ_h:TARGET_H},</p><p> success:function(data){</p><p> // display the croped photo</p><p> $('#photo_container').html(data);</p><p> }</p><p> });</p><p>}</p><p></p><p>// updateCoords : updates hidden input values after every crop selection</p><p>function updateCoords(c) {</p><p> $('#x').val(c.x);</p><p> $('#y').val(c.y);</p><p> $('#w').val(c.w);</p><p> $('#h').val(c.h);</p><p>}[/code]</p><p></p><p>das ist für die obere Funktion. also wenn man nach der Headline auf das Fotoapparat klickt.</p><p></p><p>Ich bedanke mich schon mal im vorraus für die kommende Hilfe.</p><p></p><p>Ciao brizzi</p></blockquote><p></p>
[QUOTE="brizzi, post: 2448976, member: 688877"] Hallo liebe Community, ich habe ein Javascript Problem. Und zwar wie Ihr schon der Überschrift entnehmen konntet, habe ich ein Problem mit dem Image Jcrop. Das Problem ist folgendes, wenn ich ein Bild auf meiner Seite hochlade, wird im Anschluss ein Popup fenster geöffnet, wo ich dann mein gewünschten Bereich des Bildes auswählen kann und Croppen kann. Nun ja wenn ich zu diesem Popup gelange wird mir das Bild bei ersten mal gestaucht. Breche ich es ab und versuche es erneut, wird es diesesmal richtig angezeigt. und so ist es durchgehend in Firefox. In Chrom hingegen, wird es dauerhaft gestauch angezeigt. Ich weiß da erhlich gesagt nicht weiter und weiß nicht was ich da gegen tuen soll. Hoffe Ihr könnt mir hier soweit helfen und ihr versteht was ich meine. Zum besseren verständnis werde ich noch nen Link euch geben, damit ihr es euch mal Live anschauen könnt. Hier ist der Link --> und hier mein JS Code: [code=JavaScript]// the target size var TARGET_W = 700; var TARGET_H = 450; // show loader while uploading photo function submit_photo() { // display the loading texte $('#loading_progress').html('<img src="images/loader.gif"> Uploading your photo...'); } // show_popup : show the popup function show_popup(id) { // show the popup $('#'+id).show(); } // close_popup : close the popup function close_popup(id) { // hide the popup $('#'+id).hide(); } // show_popup_crop : show the crop popup function show_popup_crop(url) { // change the photo source $('#cropbox').attr('src', url); // destroy the Jcrop object to create a new one try { jcrop_api.destroy(); } catch (e) { // object not defined } // Initialize the Jcrop using the TARGET_W and TARGET_H that initialized before $('#cropbox').Jcrop({ aspectRatio: TARGET_W / TARGET_H, setSelect: [ 100, 100, TARGET_W, TARGET_H ], onSelect: updateCoords },function(){ jcrop_api = this; }); // store the current uploaded photo url in a hidden input to use it later $('#photo_url').val(url); // hide and reset the upload popup $('#popup_upload').hide(); $('#loading_progress').html(''); $('#photo').val(''); // show the crop popup $('#popup_crop').show(); } // crop_photo : function crop_photo() { var x_ = $('#x').val(); var y_ = $('#y').val(); var w_ = $('#w').val(); var h_ = $('#h').val(); var photo_url_ = $('#photo_url').val(); // hide thecrop popup $('#popup_crop').hide(); // display the loading texte $('#photo_container').html('<img src="images/loader.gif"> Processing...'); // crop photo with a php file using ajax call $.ajax({ url: 'crop_photo.php', type: 'POST', data: {x:x_, y:y_, w:w_, h:h_, photo_url:photo_url_, targ_w:TARGET_W, targ_h:TARGET_H}, success:function(data){ // display the croped photo $('#photo_container').html(data); } }); } // updateCoords : updates hidden input values after every crop selection function updateCoords(c) { $('#x').val(c.x); $('#y').val(c.y); $('#w').val(c.w); $('#h').val(c.h); }[/code] das ist für die obere Funktion. also wenn man nach der Headline auf das Fotoapparat klickt. Ich bedanke mich schon mal im vorraus für die kommende Hilfe. Ciao brizzi [/QUOTE]
Bilder bitte
hier hochladen
und danach über das Bild-Icon (Direktlink vorher kopieren) platzieren.
Zitate einfügen…
Authentifizierung
Wenn ★ = 12, ◇ = 4 und die Hälfte von ★ zu ◇ addiert wird, was ist das Ergebnis?
Antworten
Start
Forum
Sonstiges
Webdesign, Webentwicklung & Programmierung
PHP, Javascript, jQuery, Ajax, nodeJS, MySQL...
Image Crop
Oben