cotonti.com : Add a page and then crop image https://www.cotonti.com Son konu mesajları Cotonti en Fri, 21 Nov 2025 11:03:04 -0000 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

]]>
Cmt, 13 Eyl 2014 21:16:34 -0000
Macik As I see, there are 3 way to solve a problem^

  1. Use raw «base64 PNG» image data — for that use common input field type `text`. Than decode it on serverside and save as normal PNG file.
  2. Made JS code for follows: convert `PNG data:image` → canvas → common `img` tag with desired format (PNG/JPG/GIF) → «data:image with certain format». Save it to server as noted in p.1
  3. [not sure for that] Get binary data from base64 and try to send it via AJAX emulating common POST form file uploading (`multipart/form-data`)

Note: you can not use code to attach any data via input type `file` directly.

]]>
Cmt, 13 Eyl 2014 17:26:19 -0000
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

 

 

]]>
Cmt, 13 Eyl 2014 13:16:01 -0000
Macik Check this links:

https://github.com/hongru/canvas2image
http://stackoverflow.com/questions/4356489/datauri-image-to-canvas

]]>
Cum, 12 Eyl 2014 21:57:19 -0000
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 ?

]]>
Çrş, 10 Eyl 2014 18:43:28 -0000
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 )

]]>
Çrş, 10 Eyl 2014 18:09:40 -0000
Harker I use pageavatar Version=4

]]>
Çrş, 10 Eyl 2014 13:50:45 -0000
Macik What version of «pageavatar» do you use: 2, 3 or 4 ?

Добавлено 3 минуты спустя:

Or may be «pageMavatar»?

]]>
Çrş, 10 Eyl 2014 13:37:17 -0000
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

]]>
Çrş, 10 Eyl 2014 10:05:18 -0000