uploads/picture.png stored in redis when uploaded, need uploads/picture.png instead
-
same thing. for example, take a look at the user profile pic logic here: https://github.com/designcreateplay/NodeBB/blob/master/src/routes/user.js#L180
the resolved path is saved in the db, not the relative path, To fix that, there would more logic involved to check if the image starts with
http://
orhttps://
then load it as it is, if not, then prepend therootUrl+relativeUrl+uploadPath+imagename
.. i think. .unless they want to keep track on anuploadedimage
just like the code does for the User, I am not too sure they want to deal with it or not.Even wordpress does that, I hated it when i moved from dev.site to site, or vice versa.
I would submit an issue see what the NBB team have to say.
-
@danBB, that's a bit of a messy situation but you can use the
redis-cli
for experts, or you can use a GUI like Redis Commander,npm install redis-commander -g
or something like a webGUI such as http://redsmin.com/ -
if you are familiar with the redis-cli syntax, just
# on the command line, just type redis-cli # if not in your PATH, then just cd to, i.e on my mac it's in Downloads so I just cd ~/Downloads/redis-2.6.16 ./src/redis-cli
if you're not, I would install redis-commander it's awesome, once you install it, just run:
# in your terminal redis-commander
then visit http://localhost:8081/ to view your db
EDIT yup, @trevor beat me to it as i was typing, but anyways, either ways are not a good solution if you want to edit a large number of records
-
@bentael We basically posted at the same time and the same thing almost lol.
Also, for editing large number of records, I use redsmin.
-
Also, for editing large number of records, I use redsmin.
redsmin looks awesome! the graphs and stats, but still not sure how to edit large number of records without writing some logic, just like i would do in the redis-cli or a simple node program, am I missing something?
-
wooops, this is starting to sound like my fault.
edit: if the checkbox is off, this should leave your gifs as is (see my profile pic) - otherwise I guess its a bug
-
closes #706, refactor admin image uploads, fixed gif uploads · NodeBB/NodeBB@6c30437
Node.js based forum software built for the modern web - closes #706, refactor admin image uploads, fixed gif uploads · NodeBB/NodeBB@6c30437
GitHub (github.com)
Not sure if it resolved the gifs being stored as pngs problem. I couldn't reproduce that on my environment.
This should turn image links into relative links for all uploads (category images, favicon, sitelogo, user profile images).
I also noticed animated gif uploads totally broke. It was working at some point since both I and @psychobunny had animated gifs but if you try to upload an animated gif right now on this forum it won't show up. I figured out it was due to this
im.crop({ srcPath: uploadPath, dstPath: uploadPath, width: 128, height: 128 }, function (err, stdout, stderr) { done(err); });
After some googling and SO the following seems to work for cropping animated gifs .
im.convert([uploadPath, '-coalesce', '-repage', '0x0', '-crop', '128x128+0+0', '+repage', 'uploadPath'], function(err, stdout) { done(err); });
Let me know if this resolves your issues.