Harker |
|
---|---|
Hello to all, I come towards you to find a way of making. At present I use to pageavatar to allow the users to add an image. This extension works well but when I use the crop function it is not still very attractive ex: http://hpics.li/f0eb7e2 what i'd like is that when the user adds a page it is redirected to the plugin to change the thumbnail generated by pageavatar. But i have no idea on how to do it because after adding a page, it is placed directly awaiting approval. does it go if i add the hooks page.add.last element in my plugin ? Here is the plugin that i want to add : https://github.com/mkrmpotic/Simple-Image-Crop |
Macik |
|
---|---|
What version of «pageavatar» do you use: 2, 3 or 4 ? Добавлено 3 минуты спустя: Or may be «pageMavatar»? https://github.com/macik
правильный хостинг — https://goo.gl/fjCa1F |
Harker |
|
---|---|
I use pageavatar Version=4 |
esclkm |
|
---|---|
Harker . You need totally rewrite pageavatar: because ints make crop serverside,,. But you need ajax upload + crop and only than save it to server. It's just another plugin ) littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты |
Harker |
|
---|---|
Yes, I understand what you mean but to be honest, i do not like this method with ajax. It creates a tempory files on the website and if the user stop the action, the file does not disappear (with my tests). It would create a cron file to remove the images in the temps folder etc... I find this really paintfull method ^^ I found it easier to ask the user to change the thumbnail if he wanted but only after sending the file and the creation of the first thumb. Added 2 days later: Yop, After some research, I found a script that launches the client-side script. Here it is : http://marx-tseng.appspot.com/image_crop/index.html Now I find myself with a new problem, I can upload the big picture with <input type="file"..... do you have a solution to upload the second image in an input format (gif,jpg,png) and not base64 ? |
|
This post was edited by Harker (2014-09-12 16:11, 10 years ago) |
Macik |
|
---|---|
Check this links: https://github.com/hongru/canvas2image https://github.com/macik
правильный хостинг — https://goo.gl/fjCa1F |
Harker |
|
---|---|
Thank you so much for the link With the links, I understand how to save the image created with a button "save-as" The little thing i'm trying to make is that the data : " data:image/png;base64,iVBORw0KGgoAAAANSUhEUgA............" be added to the input of PageAvatar Now, I have this => <input type="file" name="pageavatar" id="image_souce" value="" class="file" size="56" />data:image/png;base64,iVBORw0KGgoAAAANSUhEUgA....</input> but it does not read as a file and it does not work obviously I tried to change PageAvatar to change the data in the image format and then be read by the plugin but I can not do In any case, thank you for your help, it's much appreciated
|
Macik |
|
---|---|
As I see, there are 3 way to solve a problem^
Note: you can not use code to attach any data via input type `file` directly. https://github.com/macik
правильный хостинг — https://goo.gl/fjCa1F |
Harker |
|
---|---|
With the ideas that you have given me, I finally found this : http://permadi.com/blog/2010/10/html5-saving-canvas-image-data-using-php-and-ajax/ I will try to adapt the script |