KVSun / kvsun.com

Kern Valley Sun website
GNU General Public License v3.0
5 stars 10 forks source link

Allow remote images to be used as `itemprop="image" #145

Closed shgysk8zer0 closed 7 years ago

shgysk8zer0 commented 7 years ago

Steps to reproduce

  1. Create or edit a post
  2. Add an image by URL

Expected behavior

The image URL should be used as an image for the article

Actual behavior

Image will display (if allowed by CSP), but does not get stored in images table.

Screenshots and/or logs (see how to open the developer console in your browser)

Drag and drop file to upload and include in bug report

shgysk8zer0 commented 7 years ago
MariaDB [kvsun.com]> DESCRIBE `images`;
+-------------+--------------+------+-----+-------------------+----------------+
| Field       | Type         | Null | Key | Default           | Extra          |
+-------------+--------------+------+-----+-------------------+----------------+
| id          | int(10)      | NO   | PRI | NULL              | auto_increment |
| path        | varchar(80)  | NO   | UNI | NULL              |                |
| fileFormat  | varchar(12)  | NO   |     | image/jpeg        |                |
| contentSize | int(12)      | NO   |     | NULL              |                |
| uploadDate  | timestamp    | NO   |     | CURRENT_TIMESTAMP |                |
| height      | int(4)       | YES  |     | NULL              |                |
| width       | int(4)       | YES  |     | NULL              |                |
| creator     | varchar(60)  | YES  |     | NULL              |                |
| caption     | mediumtext   | YES  |     | NULL              |                |
| alt         | varchar(255) | YES  |     | NULL              |                |
| uploadedBy  | int(13)      | NO   |     | NULL              |                |
+-------------+--------------+------+-----+-------------------+----------------+
11 rows in set (0.07 sec)

Most of this won't be a problem. I'd have to download the image to get dimensions, at which point I may as well just use the local version anyways.

Does uploadedBy still apply? Should I rename it?