#StackBounty: #php #imagemagick #mediawiki Resize images upon upload in Mediawiki

Bounty: 100

I am ideally after resizing and setting a maxWidth and maxHeight on all my image uploads to mediawiki.

Having looked through the documentation of various different pages in mediawiki I am unable to find anything that says you can edit in anyway images uploaded to a site built on mediaWiki

I have no problem in writing some custom PHP but truth is I have no idea where to start looking in mediaWiki.

My thoughts are: imagemagick similarly to this:

I think you need the > flag on the resize:

convert -size 300x200 xc:red   small.png
convert -size 1000x500 xc:blue large.png
Now convert them both to 800x600 with no flags:

convert small.png -resize 800x600 a.png   # 800x533
convert large.png -resize 800x600 b.png   # 800x400
Now with flags:

convert small.png -resize 800x600> a.png # 300x200
convert large.png -resize 800x600> b.png # 800x400

But again, I cannot see where you would run this after an image upload to change the files dimensions.

Any help would be fantastic.


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.