How to edit metadata of an uploaded file to mediawiki? - image

I am using a extension with mediawiki that uses the metadata of the uploaded file to generate its title.
However I cannot see how to edit the metadata for an uploaded file in mediawiki at all.
Here is the documention for the extention:
CategoryGallery with captions generated from image description files
(requires CategoryGallery extension) You'll need
Extension:CategoryGallery for this. Place image descriptions on your
image file pages (e.g. File:Popsicle stick Eiffel Tower.jpg) using the
same PageSummary template as before. Now, on the page where you're
putting the gallery, use e.g.:
<catgallery cat="Aubry" bpdcaption="short_summary" />
The result is as
follows (note how the captions are generated using the metadata you
saved on each image page):
How can I do this? Here is an example of the files I have uplaoded: http://www.gwart.co.uk/File:Eldar_Avatar_-_Mark_Gibbons_1994.jpg

If you are talking about metadata generated by CommonsMetadata, see here. There is also metadata extracted from the file; you can't edit that, short of editing the file itself.

Related

Is that possible to embed a Blob URL image in markdown?

I want to embed a Blob URL image in my Github README.md file. When I tried ![image](blob:https://{...}) it failed. Is that possible to embed this format in markdown file?
Unfortunately github doesnt allow either blob or data uri's as image source.
source : https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#images

PDF watermarking

I want to watermark a pdf in a document management system using the device's details.
When a particular user downloads a pdf document from a document management system, it comes with the user's details watermarked.
In laravel if you have used dompdf then you can achieve this via editing blade.php file that you wish to have watermark
Or else you can use this package to override your pdf
Watermarker
Set Watermark using DomPDF-In the first step follow this url:

How to create multiple PDF file in OpenACS

Currently I can generate a single PDF file using this process:
ad_returnredirect to ADP pages (the PDF template)
Create a PDF using the eval [template::adp_compile -file $template].
ad_returnredirect "/pdfs/$folder/${fileprepend}.pdf" to file location to download.
But what I need is to generate a multiple PDF files. I tried to use the same process and add a loop... but as you can see it requires to visit the ADP pages first before it can generate template and create a PDF files, is there any other way to create a PDF files in sub-process without visiting the pages for template?
HTTP file delivery only allows one file to be returned, and there is no way to package multiple PDF files in one return. So I understand it's HTTP and not OpenACS that causes your "problem".
I'd just setup one page with links to all the PDF document you'd want the user to download. Or you could zip them together into one file.

why does web server display images corrupterd?

I have a page in JSP, which has a tag like:
<img src="images/1.bmp"></img>
The 1.bmp is like:
But the image which looks in my page, visited by firefox, is like:
what should i do to fix this problem?
I've converted the images which you uploaded into your question back to BMP and investigated their source. Everywhere where a non-ISO-8859-1 character appears in the original source, a ? appears in the malformed source.
This means that you've a servlet on /images/* which uses response.getWriter() to write the image using the platform default charset. You shouldn't do that. BMP files are not text files. BMP files are binary files. You should be using response.getOutputStream() to write binary data. You can find a basic and proper example of an image servlet in this article.

Image File Uploads Security

I am implementing a project to my site to allow users to upload image files (ai, pdf, jpeg, gif, tiff). I know this can be very risky but I was wondering what kind of security checks I should put in place to make sure these files to not cause my site any harm.
OR
Should I use something like dropbox to upload my images? If I do this is it possible to get these images whenever I want so I can display them within the browser to the user?
image uploads are fine, because you know what you want: An image
First rule is never to trust the client, so let the user upload the file (maybe you want to add an upload size limit).
Second, you have to ensure that the image is really an image so
Check the mime-type of the file (don't go by the file extension, use a real mime type check like the file shell command or an appropriate library)
To really make sure the file is OK, Open and Reprocess it using an image library like GD, ImageMagick etc. and save it to disk (keep in mind this needs some resource!). This will also filter out corrupted images.
An uploaded file usually doesn't harm the site itself but the users who download the file.
I've come across with a file uploading part of a project I worked.
Some high-level suggestions to complement sled's answer:
The mime type is set on base of the file extension, so it's no useful (as the file has not been uploaded yet to the server, the mime type is just a 'guess' in base of his extension).
So solutions would be:
Do the content check client-side (before sending the http-request)
When you get the whole file by HTTP do the check server-side before persisting to the disk.
Other Suggestions:
The simple file extension check
(wheter by filename or mime-type) is
the basic secutiry measure that also
has to be present.
Folder permissions: Don't allow execute permissions, don't allow the user to create new folders (as it might create a sub-folder with executing permissions).

Resources