image-uploading

Trouble keeping transparency with upload script

情到浓时终转凉″ 提交于 2020-01-25 18:27:26
问题 So I'm not sure what I'm doing wrong, I thought I had this working perfectly until I uploaded a PNG with a transparent background, and it saved after with a black background. Can anyone point out what I'm doing wrong? Here is my image class and upload code. I thought the 'imagecreatefrompng' section was what would keep the transparency, but maybe I'm wrong or doing it wrong? Image Class <?php ini_set("memory_limit","50M"); function normal_resize_image($source, $destination, $image_type, $max

How to update a ImageField from views in django

谁说我不能喝 提交于 2020-01-25 07:08:13
问题 Im a bit frustared trying to update a photo from a form. I have this: <form action="/subir-fotos/{{campana_id}}/{{point_id}}/" method="POST" enctype="multipart/form-data" id="form_tomaFoto{{page}}">{% csrf_token %} <input type="hidden" value="{{i.titulo_foto.id}}" name="titulo"> <p><input type="file" accept="image/*" name="foto" required></p> <p><input type="submit" value="Enviar foto" class="boton"></p> </div> </form> My model: class InteraccionFotos(models.Model): campana = models

HttpURLConnection: what does setFixedLengthStreamingMode() want the size of?

一世执手 提交于 2020-01-21 06:54:26
问题 I'm trying to upload a jpeg image buffer I got back from the Camera. I know the length, but if I pass just that length to the setFixedLengthStreamingMode() routine I get errors in the logcat telling me it expected a different size. I don't know if this is a android bug (I'm running 2.3.3 on this device), or I'm supposed to add in the sizes of headers in addition to the POST data or what. I can use setChunkedStreamingMode(0) and that works fine, but I was thinking it would be nice to avoid the

Android get Gallery image Uri path

你。 提交于 2020-01-19 05:07:30
问题 In an Activity, I can choose an image from the Gallery, and I need its Uri path (in the log, the Uri path for my test image is /content:/media/external/images/media/1 ). I'm getting this error though: 08-04 02:14:21.912: DEBUG/PHOTOUPLOADER(576): java.io.FileNotFoundException: /content:/media/external/images/media/1 (No such file or directory) 08-04 02:14:32.124: WARN/System.err(576): java.io.FileNotFoundException: /content:/media/external/images/media/1 (No such file or directory) Is this

How to resize an image after selecting it from the gallery?

拜拜、爱过 提交于 2020-01-16 16:25:55
问题 In my application I want select image from gallery or capture image from camera and upload to server. I want before send to server first resize this image with this size : 1000 x 600 then upload this. My codes: public class ImageActivity extends AppCompatActivity implements View.OnClickListener { ImageView imageView; Button pickImage, upload; private static final int REQUEST_TAKE_PHOTO = 0; private static final int REQUEST_PICK_PHOTO = 2; private Uri mMediaUri; private static final int CAMERA

How to upload image from gallary to server?

天涯浪子 提交于 2020-01-16 14:21:13
问题 I am trying to browse image from my gallery and trying to send it in server and following this tutorial http://androidexample.com/Upload_File_To_Server_-_Android_Example/index.php?view=article_discription&aid=83&aaid=106 using json but whenever I am trying to upload it shows file uploaded successfull,but when i click on browse button my gallary display nothing,so i need to first browse from gallery and show that image in my imageview and then upload successfullcan any body tell me what is

How to upload image immediately after file is selected, rather than force user to click separate “Upload” button?

末鹿安然 提交于 2020-01-16 10:31:27
问题 I have an image upload form where you click "Choose Image" and it brings up the file selection window. You choose an image and then the filename appears on the screen (not the image yet, just the filename) alongside a newly appeared "Upload" button. Then you have to hit "Upload" to make the image truly upload and appear in the preview pane. I would love to condense this process so that when someone clicks "Choose Image" and selects the image they want to upload, it removes the middle man and

How to upload image immediately after file is selected, rather than force user to click separate “Upload” button?

亡梦爱人 提交于 2020-01-16 10:31:08
问题 I have an image upload form where you click "Choose Image" and it brings up the file selection window. You choose an image and then the filename appears on the screen (not the image yet, just the filename) alongside a newly appeared "Upload" button. Then you have to hit "Upload" to make the image truly upload and appear in the preview pane. I would love to condense this process so that when someone clicks "Choose Image" and selects the image they want to upload, it removes the middle man and

Prevent image upload code injection

半城伤御伤魂 提交于 2020-01-16 05:00:07
问题 I have a form which the user fills with lyrics information and uploads an album cover. Submitted data will be inserted into a database and the album cover will be moved to a subfolder. localhost/project-folder/covers I've taken some precautions (escaping, prepated statements) against SQL Injection for the form input. Recently, I've learned that I also need to take precautions for file (image) upload, that the user can upload malicious images. For example, adding HTML, JS or PHP code in image

Why Jquery image uploader doesn't upload image

强颜欢笑 提交于 2020-01-16 04:36:29
问题 This code is taken from AJAX Image upload using PHP I have copied the code to these files: index.html, style.css, script.js, ajax_php_file.php and downloaded NoImage.jpg. Then I selected the image from my PC and the photo has been changed on client side to the selected image. Then I clicked upload and no file has been uploaded to the folder where php script was called. Tested in Firefox 32 Firebug console and no errors reported. I also tried this with Jquery 2.2.2 with error telling me that e