News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Update attachment size (height/width) in DB

Started by kokett, February 13, 2010, 03:58:42 PM

Previous topic - Next topic

kokett

Hello,

is there a tool or mod to update resolutions of attached images saved in database? I've manually resized images but with maintenance in ACP only filesize will be corrected, but I need to update resolution too.

Thanks and greetings

kokett

Kays


If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

kokett

Hi,

great, I've searched a lot without a result. But that is what I'm looking for. Thank you very much.

Kays

It's a big forum and search returns too many results at times. ::)

If this does resolve your issue. Could you mark it as solved by clicking on the green "Mark Topic Solved" button below.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

kokett

Hi,

I would like to say that in my case I had to adjust the script a bit. Between line 78 and 85 I changed the query as follows:


// Get the attachments w/o a width and height.
$request = db_query("
SELECT ID_ATTACH, filename, width, height
FROM {$db_prefix}attachments
WHERE $extensions
AND height > 1280
AND ID_MEMBER = 0
LIMIT $_GET[start], 100", __FILE__, __LINE__);


and in the second case:


// Get the attachments w/o a width and height.
$request = db_query("
SELECT ID_ATTACH, filename, width, height
FROM {$db_prefix}attachments
WHERE $extensions
AND width > 1280
AND ID_MEMBER = 0
LIMIT $_GET[start], 100", __FILE__, __LINE__);


I've manually reduced the max dimensions of all images to 1280 proportionally and uploaded them back. Then I ran the script as described.

Kays


If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Advertisement: