Questions tagged [image]

This tag is for questions related to the loading, formatting, saving, compression, and display of data representing pictures.

Filter by
Sorted by
Tagged with
1
vote
2answers
9k views

Validating uploaded images

I have attempted to write a method that checks that images being uploaded are valid. ...
1
vote
2answers
127 views

Modifying an image URL based on hash options

The code I'm trying to improve modifies a URL according to the options passed in a hash: { :image_aspect_ratio => "square", :image_size => 50 } or <...
1
vote
1answer
205 views

Responsive image solution

I just made this responsive image solution, but I'm not sure if it's the best way to do what I'm trying to achieve. Use cases can be found at http://responsimage.com/. ...
1
vote
1answer
51 views

Сlone image in pure js

I wrote JS to clone image and attached this action to button. It works but I'm not sure that this better way to do it. My questions: is it correct to use querySelector to return elements, or is it ...
1
vote
1answer
202 views

PHP JPG image re-creation from original file

A third party can upload files via FTP to a client's webserver. These images should be displayed on a public-available webpage. The upload directory is not accessible via normal HTTP. To increase ...
1
vote
1answer
423 views

Drawing pixel to pixel

I'm drawing a pixel by pixel image with the following code: ...
1
vote
2answers
270 views

Efficient image generation with nodejs

I have an app written with node.js, I have a function which takes an image file name and generates a few variations of this image, code below. The issue I am having is that when I have to generate ...
1
vote
2answers
55 views

Code that rotates images in a set of divs

I am rotating images inside some divs. An image is associated with a link.Eg: image0 is associated with link0, image1 with link1 and so on. image0 and link0 should display in pos-1 image1/link1 ...
1
vote
1answer
530 views

“Images” exercise from A Tour of Go

The "Images" exercise in A Tour of Go asks for an implementation of image.Image. I wrote two solutions, one easy and one harder (just for practice in dealing with ...
1
vote
1answer
1k views

Padding an image for convolution (image processing)

I have written the following routines. Do you know of any better algorithm? Is there any faster way to pad an image for image processing? How can I optimize them for better performance? ...
1
vote
1answer
462 views

Setting and showing an image file on a QGraphicsView

This code sets and shows an image file on a QGraphicsView. I'm interested in seeing how to improve readability and reduce redundancy. ...
1
vote
1answer
73 views

Adjusting the height of a div to match that of another column

This code checks whether an image whose parent is .papers.left has completely loaded into DOM and if yes then the background of ...
1
vote
1answer
32 views

Check that an image is available to be served

I have a couple of images in my database and I need to check if the images are still good or if they're deleted or corrupted. I came up with a solution but it's very slow. I was wondering if there was ...
1
vote
1answer
585 views

Resize images in the background after upload

I have working code that uploads and resizes images. What im trying to figure out is how I can direct the browser to another page or view kind of the way facebook does, but still call the resize ...
1
vote
1answer
305 views

Storing Data In a Image pixels

I wrote a tool to store text as colors in a image around the border. I then saved the resulting image to file. To use the resulting file I set it's path to a the src attribute of a tag and call ...
1
vote
1answer
611 views

Image manipulation PHP class using PHP's Image Functions

I am working on an image manipulation class for a project to re-size uploaded slider images to 780 X 397 and uploaded avatar pictures to 220 X 220. I am wondering if this is a good way to construct it....
1
vote
1answer
1k views

Show image when in viewpoint of browser window

I am working on a web project and am trying to create a way to detect when an image is in viewpoint of the browser window then load/show the image. Since there are some rather large image that are ...
1
vote
1answer
58 views

Grey to Colored Image

I want to improve the code, in which you can enter a grey bitmap and it will return you a colored one. ...
1
vote
2answers
138 views

Image/content slider

I've built an image/content slider using JavaScript and as I've added to it and built in new functionality I've found myself writing several if statements in order to achieve the required response. I'...
1
vote
1answer
195 views

Load bitmap object data into array of byte values

I'm building this as part of a larger class to rapidly search for smaller images inside larger images. This is my first serious F# project so comments especially concerning style and organization are ...
1
vote
2answers
1k views

Converting an image to a bitmap

What the code does is convert an image to a bitmap without having to create 3 arrays to make the conversion. It basically uses 1/3rd of the memory that it would normally use. I'm trying to refactor ...
1
vote
1answer
419 views

Website with images that pan to different sides

I've just started programming with JavaScript and I am currently working on this hobby website project of mine. The site is supposed to display pages filled with product images than can be "panned" to ...
1
vote
1answer
1k views

Loading of images

I recently started game development, but one of the things that I never put much thought to was the loading of images. I'm curious as to advice for improving my current code on loading images. I'm ...
1
vote
1answer
176 views

Animation that gets triggered by two buttons

In order for me to get better and create more desired code, I would like to find out if the following situation is bad or acceptable. I am creating an animation that gets triggered by two buttons, ...
1
vote
0answers
37 views

Photo rename by Exif date and group into folders with a threshold

I wrote this tiny F# project yesterday, but I am a bit rusty and I would like to know if there is anything I can refactor and make more elegant. ...
1
vote
1answer
35 views

Rails controller method to show an optionally scaled image using MiniMagick

I've got below implementation for my controller and show action which implements MiniMagick gem. I've just wondering is there any better way to write it down? If ...
1
vote
0answers
58 views

Proper image sizes in WordPress

I wanted to create a set of functions that would allow me to easily implement images for multiple screen resolutions in my custom page templates. WordPress offers some functionality for implementing ...
1
vote
0answers
170 views

Python3 - Cropping PDF files according to coordinates

I have a python script, that is performing OCR on PDF pages. I am trying to do so I can provide coordinates to the script - so it will only select the text within the provided coordinates ...
1
vote
0answers
37 views

How to speed up the retrieval of the corners of a mask

I have trained a polygon detector neural network to recognize the mask of "quadrilateral" (the mask generates curvy lines so it's not exactly a quadrilateral). I would like to get the corners of the ...
1
vote
0answers
53 views

Android app to take a photos and show them in a gallery

Gallery will be displayed in RecyclerView. User can select some images and delete it with one button. It all works, but i think I have bad code, because I don't use some instruments (like fragment). ...
1
vote
0answers
286 views

Scraper for parsing, downloading, and setting images beside each link in an excel file

I've written a script in VBA which is able to parse image links from a website, download and store them in a local folder and finally set those images beside each link in an excel file. As the script ...
1
vote
0answers
155 views

Image color reduction

Just for the fun of it, I was looking of ways to make true-color GIFs. I've started to write the code, and it clicked me: this won't work for that, but it does make a nice color-reduction method. ...
1
vote
0answers
623 views

Texture Loading in LWJGL 3 - follow-up

Here's my optimized Texture class: ...
1
vote
1answer
594 views

Texture loading in LWJGL 3

I made the following class to simpify texture loading in LWJGL 3, and modeled it after the slick-util API: ...
1
vote
0answers
202 views

Unit test for my image resizer class

I made a class that will be used to get an image properties like width, height, and MIME type. ...
1
vote
2answers
70 views

Scaling and cropping an image adaptively based on the window dimensions [closed]

I've tried my best (I'm new to JS) to write a script that make an image fit to its parent div with respect of the ratio and overflowing when needed. For example, if the ...
1
vote
0answers
2k views

Image gallery with pagination using CSS, $_GET, and Bootstrap

I am relatively new to web development and I created an image gallery with pagination using the Twitter Bootstrap framework. Basically, I want to know if I approached creating an image gallery ...
1
vote
1answer
2k views

CakePHP image upload component

I would like to know how I can improve this CakePHP 3.0 Component (inside folder controller) 1st: to use external libs (stored on vendor folder) I'm using the <...
1
vote
0answers
90 views

Overlay on an image

This is, for instance, used on this page, and it overlays the main product picture with some DIVs: ...
1
vote
0answers
531 views

URL image validation

I'm trying to write a method to validate an image from a URL. The method will accept an array of image URL. The image should be validated by its type, size and dimensions. Right now, I'm able to ...
1
vote
0answers
470 views

Image upload handling in Laravel

I'm trying to create a handler to set the profile picture for the user. Don't worry about the validation as I will clean that up, because that's for testing purposes. This is how far I went. I'm using ...
1
vote
0answers
448 views

Imgur .png image-fetcher

I'm making a script that generates imgur.com URLs which contain only .png images bigger than 256 bytes, but smaller than 1200 bytes. Problem: the script is as slow ...
0
votes
2answers
839 views

BMP writer in C

I recently wrote a BMP writer in C: bmpWriter.h ...
0
votes
3answers
386 views

Image Carousel in JavaScript

I created a very basic "image projector" that shows the current one and shows the next on clicking into the image. And yeah, it works, but I don't think that's a very elegant way to do it. Any advice ...
0
votes
3answers
157 views

Processing image blocks using a task runner

This code works, but I'm sure it isn't written according to "best practices" for closures. On the other hand, at least it's intuitive to me... the taskRunner object runs functions on setTimeout, so ...
0
votes
1answer
206 views

Image-processing filters using decorator pattern in Python 3

The goal of the following short Python 3 program is to improve my understanding of the decorator design pattern. Therefore, I would be mostly interested about feedback on this aspect, i.e. whether ...
0
votes
2answers
2k views

Optimize code use to drawing image

Below I have posted the code I use for drawing pictures. The problem is that when I want to generate more images in full hd size (in loop), the generation time increases significantly. Can somehow ...
0
votes
1answer
635 views

Updating clock with Canvas

I am very new to JavaScript and was wondering what kind of process or design pattern is most common among JavaScript developers. So far I have following code ...
0
votes
1answer
218 views

Iteration and memcache for selected categorized random elements

The following code is a quick implementation since I only needed 3 random images sorted by category (a random eyes image, a random nose image and a random mouth image and then combine them): ...
0
votes
1answer
32 views

Upload image with GD library

First of all I just started learning OOP. My priority is to make safe code. I think my code is safe, because I use GD to make a copy of the uploaded image and I use an image proxy to make sure nobody ...