Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
ATLAS-178: Support upload of marker images #95
@bmamlin @cintiadr I just realized that the way I changed the database may be troublesome for the RSS feed if we'd like to display image links. I think we'll need an API to retrieve images to keep everything consistent. What do you think? If the API idea seems fine, then how to we structure the url?
Great job! I've ran into a few issues testing this and I believe they are related:
When I tried uploading an image that's ~119 KB, I got an error message that looked like a
When I upload an image, I have to reload the page before it shows in the marker.
The biggest change I think we need is more significant. Storing the image in the database is fine (especially with limiting the size they can be); however, I do not like storing the image data directly within the marker resource for a few reasons:
To address this, I would suggest designing the marker resource to have a read-only
If we can get around the payload size issues of node/express, then you could allow a marker to be
@bmamlin After an hour of searching, I finally figured out how to send data strings as images. -_-;
While fixing up the remaining code to use the API, I feel like it would be easier to have a new table for images (say atlas_images(id, datastring)), or separate columns for image-data and image-url. It would make the code more readable, and we won't need to alter the image column manually everytime a GET is being performed. Additionally, markers currently using external links won't be affected. What do you think of this?
The PR for the initial plan (having a single image column in the atlas table) is almost complete, so I'm fine with either. :)
4 times, most recently
Jul 13, 2019
Changes look great!
You could avoid unnecessarily getting all the images from the database & having to manually insert urls by replacing
IF(image, concat(?,'://',?,'/marker/',id,'/image'), null) AS image_url,
Otherwise, I suggested a small styling change to the image size tip. If you can apply those changes, we can merge this PR. We'll need to add a mechanism for image removal... but we could add that in a subsequent ticket.
@bmamlin I made the changes :)
is an amazing idea, and completely eliminates the need for a new column! I had to tweak it to
Its weird why the former doesn't work, but I thought I'd report the observation, as its something I may probably waste a lot of time on in the future if I didn't remember it. :p
While testing, please also take a look at the RSS feed, and the marker csv, as I made a few tiny changes to them while getting this PR working. :)