Changeset 2909042
- Timestamp:
- 05/07/2023 11:24:51 AM (3 years ago)
- Location:
- easy-image-filters/trunk
- Files:
-
- 5 edited
-
README.txt (modified) (2 diffs)
-
admin/class-easy-image-filters-admin.php (modified) (4 diffs)
-
admin/js/easy-image-filters-admin.js (modified) (1 diff)
-
easy-image-filters.php (modified) (1 diff)
-
includes/class-easy-image-filters.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
easy-image-filters/trunk/README.txt
r2106570 r2909042 3 3 Tags: media library, image, filter, effects, colorize, hue, sepia, manipulation, editing, html5,canvas, browser, brightness, contrast, vibrance, noise, presets 4 4 Requires at least: 4.0 5 Tested up to: 5.2.16 Stable tag: 1.0. 15 Tested up to: 6.2 6 Stable tag: 1.0.2 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 45 45 == Changelog == 46 46 47 = 1.0.2 = 48 * Fix image generation. 49 * Improve security. 50 47 51 = 1.0.1 = 48 52 * Tested upto WordPress 4.8. -
easy-image-filters/trunk/admin/class-easy-image-filters-admin.php
r1331905 r2909042 114 114 wp_enqueue_script( 'caman-js', plugin_dir_url( __FILE__ ) . 'js/caman.full.min.js', array( 'jquery' ), $this->version, true ); 115 115 wp_enqueue_script( 'material-js', plugin_dir_url( __FILE__ ) . 'js/material.min.js', array( 'jquery' ), $this->version, false ); 116 117 $translation_array = array( 118 'eif_ajax_nonce' => wp_create_nonce( 'eif-ajax-nonce' ), 119 ); 120 121 wp_localize_script( $this->plugin_name, 'eif_js_obj', $translation_array ); 116 122 } 117 123 … … 157 163 158 164 public function easy_image_filters_save_image_ajax_callback() { 165 166 check_ajax_referer( 'eif-ajax-nonce', '_nonce_check' ); 167 159 168 $uploads = wp_upload_dir(); 160 169 $filetype_info = wp_check_filetype( $_POST['old_image'] ); … … 179 188 $success = wp_update_attachment_metadata( $attach_id, $attach_data ); 180 189 181 if( $success){190 if( ! empty( $attach_id ) && ! is_wp_error( $attach_id ) ){ 182 191 echo add_query_arg( 'item', $attach_id, admin_url('upload.php') ); 183 192 }else{ … … 185 194 } 186 195 187 exit(0);196 wp_die(); 188 197 189 198 } -
easy-image-filters/trunk/admin/js/easy-image-filters-admin.js
r1331905 r2909042 2 2 'use strict'; 3 3 4 $(document).ready(function() { 5 var eif_img = $('#eif-image').data('img'); 6 var eif_red, eif_green, eif_blue, eif_brightness, eif_contrast, eif_vibrance, eif_saturation, eif_exposure, eif_hue, eif_sepia, eif_gamma, eif_noise, eif_clip, eif_sharpen, eif_stackBlur; 4 $( document ).ready( 5 function() { 6 var eif_img = $( '#eif-image' ).data( 'img' ); 7 var eif_red, eif_green, eif_blue, eif_brightness, eif_contrast, eif_vibrance, eif_saturation, eif_exposure, eif_hue, eif_sepia, eif_gamma, eif_noise, eif_clip, eif_sharpen, eif_stackBlur; 7 8 8 eif_red= eif_green = eif_blue = eif_brightness = eif_contrast = eif_vibrance = eif_saturation = eif_exposure = eif_hue = eif_sepia = eif_gamma = eif_noise = eif_clip = eif_sharpen = eif_stackBlur = 0;9 eif_gamma = 1;9 eif_red = eif_green = eif_blue = eif_brightness = eif_contrast = eif_vibrance = eif_saturation = eif_exposure = eif_hue = eif_sepia = eif_gamma = eif_noise = eif_clip = eif_sharpen = eif_stackBlur = 0; 10 eif_gamma = 1; 10 11 11 Caman('#eif-image', eif_img, function() { 12 this.render(); 13 }); 12 Caman( 13 '#eif-image', 14 eif_img, 15 function() { 16 this.render(); 17 } 18 ); 14 19 15 $('#eif-presets').on('click', '.eif-preset-button', function(event) { 16 $('#eif-loader').show(); 17 var eif_preset = $(this).data('preset'); 20 $( '#eif-presets' ).on( 21 'click', 22 '.eif-preset-button', 23 function(event) { 24 $( '#eif-loader' ).show(); 25 var eif_preset = $( this ).data( 'preset' ); 18 26 19 Caman('#eif-image', eif_img, function() { 20 this.revert(true); 27 Caman( 28 '#eif-image', 29 eif_img, 30 function() { 31 this.revert( true ); 21 32 22 switch (eif_preset) {23 case 'brightness':24 this.brightness(30);25 break;33 switch (eif_preset) { 34 case 'brightness': 35 this.brightness( 30 ); 36 break; 26 37 27 case 'noise':28 this.noise(10);29 break;38 case 'noise': 39 this.noise( 10 ); 40 break; 30 41 31 case 'contrast':32 this.contrast(10);33 break;42 case 'contrast': 43 this.contrast( 10 ); 44 break; 34 45 35 case 'sepia':36 this.sepia(10);37 break;46 case 'sepia': 47 this.sepia( 10 ); 48 break; 38 49 39 case 'colorize':40 this.colorize(60, 105, 218, 10);41 break;50 case 'colorize': 51 this.colorize( 60, 105, 218, 10 ); 52 break; 42 53 43 case 'tiltShift': 44 this.tiltShift({ 45 angle: 90, 46 focusWidth: 600 47 }); 48 break; 54 case 'tiltShift': 55 this.tiltShift( 56 { 57 angle: 90, 58 focusWidth: 600 59 } 60 ); 61 break; 49 62 50 case 'posterize':51 this.posterize(8, 8);52 break;63 case 'posterize': 64 this.posterize( 8, 8 ); 65 break; 53 66 54 default:55 this[eif_preset]();56 break;57 }67 default: 68 this[eif_preset](); 69 break; 70 } 58 71 59 this.render(function(){ 60 $('#eif-loader').hide(); 61 }); 62 63 }); 64 }); 65 66 67 $('#eif-filters').on('change', 'input', function(event) { 68 var eif_changed_value = this.value; 69 var eif_filter = $(this).data('filter'); 70 71 Caman('#eif-image', eif_img, function() { 72 this.revert(false); 73 74 switch (eif_filter) { 75 case 'red': 76 this.channels({ red: eif_changed_value }); 77 break; 78 79 case 'green': 80 this.channels({ green: eif_changed_value }); 81 break; 82 83 case 'blue': 84 this.channels({ blue: eif_changed_value }); 85 break; 86 87 case 'gamma': 88 eif_changed_value = parseFloat(eif_changed_value); 89 this[eif_filter](eif_changed_value); 90 break; 91 92 default: 93 eif_changed_value = parseInt(eif_changed_value); 94 this[eif_filter](eif_changed_value); 95 } 96 97 this.render(); 98 }); 99 100 }); 101 102 $('#eif-save').on('click',function(){ 103 Caman("#eif-image",eif_img, function () { 104 105 var image = this.toBase64(); 106 $('#eif-loader').show(); 107 108 //save To Server 109 110 var data = { 111 'action': 'eif_save_image', 112 'old_image': eif_img, 113 'new_image': image, 114 }; 115 116 // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php 117 $.post(ajaxurl, data, function(response) { 118 119 if("error" != response ){ 120 window.location = response; 121 } 122 else { 72 this.render( 73 function(){ 74 $( '#eif-loader' ).hide(); 75 } 76 ); 123 77 124 78 } 125 });126 });127 });79 ); 80 } 81 ); 128 82 129 $('#eif-reset').on('click',function(){ 130 Caman("#eif-image",eif_img, function () { 131 this.revert(true); 83 $( '#eif-filters' ).on( 84 'change', 85 'input', 86 function(event) { 87 var eif_changed_value = this.value; 88 var eif_filter = $( this ).data( 'filter' ); 132 89 133 $('#eif-filters .mdl-slider').each(function(index) { 134 this.MaterialSlider.change(0); 135 }); 90 Caman( 91 '#eif-image', 92 eif_img, 93 function() { 94 this.revert( false ); 136 95 137 }); 138 }); 96 switch (eif_filter) { 97 case 'red': 98 this.channels( { red: eif_changed_value } ); 99 break; 139 100 140 }); 101 case 'green': 102 this.channels( { green: eif_changed_value } ); 103 break; 104 105 case 'blue': 106 this.channels( { blue: eif_changed_value } ); 107 break; 108 109 case 'gamma': 110 eif_changed_value = parseFloat( eif_changed_value ); 111 this[eif_filter]( eif_changed_value ); 112 break; 113 114 default: 115 eif_changed_value = parseInt( eif_changed_value ); 116 this[eif_filter]( eif_changed_value ); 117 } 118 119 this.render(); 120 } 121 ); 122 123 } 124 ); 125 126 $( '#eif-save' ).on( 127 'click', 128 function(){ 129 Caman( 130 "#eif-image", 131 eif_img, 132 function () { 133 134 var image = this.toBase64(); 135 $( '#eif-loader' ).show(); 136 137 //save To Server 138 139 var data = { 140 'action': 'eif_save_image', 141 'old_image': eif_img, 142 'new_image': image, 143 '_nonce_check': eif_js_obj.eif_ajax_nonce, 144 }; 145 146 // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php 147 $.post( 148 ajaxurl, 149 data, 150 function(response) { 151 152 if ( "error" !== response ) { 153 window.location = response; 154 } else { 155 156 } 157 } 158 ); 159 } 160 ); 161 } 162 ); 163 164 $( '#eif-reset' ).on( 165 'click', 166 function(){ 167 Caman( 168 "#eif-image", 169 eif_img, 170 function () { 171 this.revert( true ); 172 173 $( '#eif-filters .mdl-slider' ).each( 174 function(index) { 175 this.MaterialSlider.change( 0 ); 176 } 177 ); 178 179 } 180 ); 181 } 182 ); 183 184 } 185 ); 141 186 142 187 })( jQuery ); -
easy-image-filters/trunk/easy-image-filters.php
r1675341 r2909042 17 17 * Plugin URI: https://wordpress.org/plugins/easy-image-filters 18 18 * Description: Add cool filters and effects to images without leaving site admin screen. Save new image without loosing original. 19 * Version: 1.0. 119 * Version: 1.0.2 20 20 * Author: Kiran Potphode 21 21 * License: GPL-2.0+ -
easy-image-filters/trunk/includes/class-easy-image-filters.php
r1331905 r2909042 70 70 71 71 $this->plugin_name = 'easy-image-filters'; 72 $this->version = '1.0. 0';72 $this->version = '1.0.2'; 73 73 74 74 $this->load_dependencies();
Note: See TracChangeset
for help on using the changeset viewer.