Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-08-20 03:40:07

graumeister
Plugin Author
From: Ban Bang Por, Samui, Thailand
Registered: 2005-01-16
Posts: 167
Website

[plugin] [ORPHAN] glx_admin_image_resize

Notice: This thread is archived, this plugin is no longer supported but it can be copied from this page.

**********************************************************

Hi all, after mailing with Johan i took ownership of both plugins developed by him glx_admin_image_resize and glx_gravatar. He currently is out of time to maintain them and I use them, so why not?

At grauhirn.org you find version 2006.1 of the plugin with two small fixes in presentation of the form. Documentation and use of the plugin is still the same as described in this thread.

If you have any thought about new features, gimmicks and addons to the plugin please dont wait with suggestions as I am starting to work on a new version soon. This thread would be a good place ;)

todo:

  • handling of gif- and png-graphics
YToxMDp7czo0OiJuYW1lIjtzOjE1OiJnbHhfYWRtaW5faW1hZ2UiO3M6NjoiYXV0aG9yIjtzOjE1OiJkZXIgR3JhdU1laXN0ZXIiO3M6MTA6ImF1dGhvcl91cmkiO3M6NDc6Imh0dHA6Ly9ncmF1aGlybi5vcmcvcGF0dGVybnRleHQvZ2x4X2FkbWluX2ltYWdlIjtzOjc6InZlcnNpb24iO3M6NjoiMjAwNi4xIjtzOjExOiJkZXNjcmlwdGlvbiI7czo0NToiYWR2YW5jZWQgaW1hZ2UgZWRpdGluZyBhbmQgdGh1bWJuYWlsIGNyZWF0aW9uIjtzOjQ6ImhlbHAiO3M6NDkyNDoiPHA+PHN0eWxlIHR5cGU9InRleHQvY3NzIj4uZ2hve2JhY2tncm91bmQtY29sb3I6IzIyMjtjb2xvcjojY2NjO2ZvbnQtZmFtaWx5OlZlcmRhbmEsc2Fucy1zZXJpZjtmb250LXNpemU6MC44ZW07cG9zaXRpb246cmVsYXRpdmU7bWFyZ2luOjE1cHggYXV0bztwYWRkaW5nOjEwcHg7dGV4dC1hbGlnbjpsZWZ0O3dpZHRoOjc0MHB4O30uZ2hvIHB7cGFkZGluZzo1cHg7YmFja2dyb3VuZC1jb2xvcjojMjgyODI4O2JvcmRlcjoxc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zdCA9ICRnZFsnY3JlYXRlJ10oJGhlaWdodCwkd2lkdGgpOwogICAgfSBlbHNlewogICAgICAgICRkc3QgPSAkZ2RbJ2NyZWF0ZSddKCR3aWR0aCwkaGVpZ2h0KTsKICAgIH07CiAgICBmb3IoJHk9MDskeTwkaGVpZ2h0OyR5KyspewogICAgICAgIGZvcigkeD0wOyR4PCR3aWR0aDskeCsrKXsKICAgICAgICAgICAgc3dpdGNoKCRhbmdsZSl7CiAgICAgICAgICAgICAgICBjYXNlIDkwOgogICAgICAgICAgICAgICAgICAgIGltYWdlY29weSgkZHN0LCAkc3JjLCAkaGVpZ2h0LSR5LTEsICR4LCAkeCwgJHksIDEsIDEpOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgY2FzZSAxODA6CiAgICAgICAgICAgICAgICAgICAgaW1hZ2Vjb3B5KCRkc3QsICRzcmMsICR4LCAkeSwgJHdpZHRoLSR4LTEsICRoZWlnaHQtJHktMSwgMSwgMSk7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICBjYXNlIDI3MDoKICAgICAgICAgICAgICAgICAgICBpbWFnZWNvcHkoJGRzdCwgJHNyYywgJHksICR3aWR0aC0keC0xLCAkeCwgJHksIDEsIDEpOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgICAgICBpbWFnZWNvcHkoJGRzdCwgJHNyYywgJHgsICR5LCAkeCwgJHksIDEsIDEpOwogICAgICAgICAgICB9OwogICAgICAgIH07CiAgICB9OwogICAgaW1hZ2VkZXN0cm95KCRzcmMpOwogICAgcmV0dXJuKCRkc3QpOwp9Ci8qKgogKiBDaGVjayBpZiB2YWx1ZSBpcyBwcmVjZW50CiAqIEJ5IFppUQogKi8KZnVuY3Rpb24gemlxSXNQZXJjZW50KCR4KSB7CiAgICBpZiAoaXNfbnVtZXJpYygkeCkpIHsKICAgICAgICAkdG1wID0gaW50dmFsKCR4KTsKICAgICAgICBpZiAoJHRtcCA+PSAxMCAmJiAkdG1wIDw9IDEwMCkgewogICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICB9OwogICAgfTsKICAgIHJldHVybiBmYWxzZTsKfQpmdW5jdGlvbiBnbHhfaW1hZ2Vfcm90YXRlKCkgewogICAgZ2xvYmFsICRwYXRoX3RvX3NpdGU7CiAgICAkcm90YXRlX3ZhbHVlID0gcHMoInJvdGF0ZVZhbHVlIikgPyBwcygicm90YXRlVmFsdWUiKSA6IDA7CiAgICAkaW1hZ2VfaWQgPSBwcygiaWQiKSA/IHBzKCJpZCIpIDogMDsKICAgICRzb3VyY2UgPSBJTVBBVEguJGltYWdlX2lkLicuanBnJzsKICAgIC8vIGdldCB0aGUgcmlnaHQgZGVncmVlCiAgICAkZGVncmVlcyA9IDA7CiAgICBzd2l0Y2ggKCRyb3RhdGVfdmFsdWUpIHsKICAgICAgICBjYXNlICIxODAiOgogICAgICAgICAgICAkZGVncmVlcyA9IDE4MDsKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSAiOTBDVyI6CiAgICAgICAgICAgICRkZWdyZWVzID0gMjcwOwogICAgICAgICAgICBicmVhazsKICAgICAgICBjYXNlICI5MENDVyI6CiAgICAgICAgICAgICRkZWdyZWVzID0gOTA7CiAgICAgICAgICAgIGJyZWFrOwogICAgfTsKICAgIC8vIHJvdGF0ZSBpbWFnZQogICAgJGltID0gaW1hZ2VjcmVhdGVmcm9tanBlZygkc291cmNlKTsKICAgIGlmIChmdW5jdGlvbl9leGlzdHMoJ2ltYWdlcm90YXRlJykpIHsKICAgICAgICAkaW0gPSBpbWFnZXJvdGF0ZSgkaW0sICRkZWdyZWVzLCAwKTsKICAgIH0gZWxzZSB7CiAgICAgICAgJGltID0gZ2x4X29sZF9pbWFnZV9yb3RhdGUoJGltLCAkZGVncmVlcyk7CiAgICB9OwogICAgaW1hZ2VqcGVnKCRpbSwgJHNvdXJ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anBnJzsKICAgIGlmIChmaWxlX2V4aXN0cygkc291cmNlKSAmJiAoJGRvX3Jlc2l6ZV90aHVtYiA9PSAxIHx8ICRkb19yZXNpemVfbGFyZ2UgPT0gMSkpIHsKICAgICAgICAvLyBjaGVjayBjdXJyZW50IEdEIHZlcnNpb24KICAgICAgICAkZ2QgPSBnbHhfZ2V0X2dkX3ZlcnNpb24oKTsKICAgICAgICAkc2l6ZSA9IGdldGltYWdlc2l6ZSgkc291cmNlKTsKICAgICAgICAkeCA9ICRzaXplWzBdOwogICAgICAgICR5ID0gJHNpemVbMV07CiAgICAgICAgaWYgKCRzaWRlX3RodW1iID09ICdsb25nZXN0Jyl7CiAgICAgICAgICAgIGlmICgkeCA+ICR5KSB7CiAgICAgICAgICAgICAgICAkbWF4ID0gJHg7CiAgICAgICAgICAgICAgICAkbWluID0gJHk7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAkbWF4ID0gJHk7CiAgICAgICAgICAgICAgICAkbWluID0gJHg7CiAgICAgICAgICAgIH07CiAgICAgICAgfSBlbHNlaWYgKCRzaWRlX3RodW1iID09ICdoZWlnaHQnKXsKICAgICAgICAgICAgJG1heCA9ICR5OwogICAgICAgICAgICAkbWluID0gJHg7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgJG1heCA9ICR4OwogICAgICAgICAgICAkbWluID0gJHk7CiAgICAgICAgfTsKICAgICAgICBpZiAoJGRvX3Jlc2l6ZV90aHVtYiA9PSAxKSB7CiAgICAgICAgICAgIC8vIHRodW1iCiAgICAgICAgICAgICRyYXRlX3RodW1iID0gJG1heCAvICRsYXJnZXN0X3NpZGVfdGh1bWI7CiAgICAgICAgICAgICRmaW5hbF94X3RodW1iID0gJHggLyAkcmF0ZV90aHVtYjsKICAgICAgICAgICAgJGZpbmFsX3lfdGh1bWIgPSAkeSAvICRyYXRlX3RodW1iOwogICAgICAgICAgICAvLyBjcmVhdGUgdGh1bWIKICAgICAgICAgICAgaWYgKCRzcXVhcmVfaW1hZ2UgPT0gMSkgewogICAgICAgICAgICAgICAgJHJlc2l6ZV90aHVtYiA9ICRnZFsnY3JlYXRlJ10oJGxhcmdlc3Rfc2lkZV90aHVtYiwgJGxhcmdlc3Rfc2lkZV90aHVtYik7CiAgICAgICAgICAgICAgICAkaW1fdGh1bWIgPSBpbWFnZWNyZWF0ZWZyb21qcGVnKCRzb3VyY2UpOwogICAgICAgICAgICAgICAgaWYgKE1FVEhPRCA9PSAyKXsKICAgICAgICAgICAgICAgICAgICBpZigkeCA+ICR5KSB7CiAgICAgICAgICAgICAgICAgICAgICAgICR4MCA9ICgkeCAtICR5KSAvIDI7CiAgICAgICAgICAgICAgICAgICAgICAgICR4MSA9ICR5OwogICAgICAgICAgICAgICAgICAgICAgICAkeTAgPSAwOwogICAgICAgICAgICAgICAgICAgICAgICAkeTEgPSAkeTsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAkeDAgPSAwOwogICAgICAgICAgICAgICAgICAgICAgICAkeDEgPSAkeDsKICAgICAgICAgICAgICAgICAgICAgICAgJHkwID0gKCR5IC0gJHgpIC8gMjsKICAgICAgICAgICAgICAgICAgICAgICAgJHkxID0gJHg7CiAgICAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgICAgICAkZ2RbJ2NvcHknXSgkcmVzaXplX3RodW1iLCAkaW1fdGh1bWIsIDAsIDAsJHgwLCR5MCwgJGxhcmdlc3Rfc2lkZV90aHVtYiwgJGxhcmdlc3Rfc2lkZV90aHVtYiwgJHgxLCAkeTEpOwogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAkZ2RbJ2NvcHknXSgkcmVzaXplX3RodW1iLCAkaW1fdGh1bWIsIDAsIDAsIDAsIDAsICRsYXJnZXN0X3NpZGVfdGh1bWIsICRsYXJnZXN0X3NpZGVfdGh1bWIsICRsYXJnZXN0X3NpZGVfdGh1bWIgKiAxLjUsICRsYXJnZXN0X3NpZGVfdGh1bWIgKiAxLjUpOwogICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgICRzb3VyY2VfdGh1bWIgPSBJTVBBVEguJGltYWdlX2lkLid0LmpwZyc7CiAgICAgICAgICAgICAgICBpbWFnZWpwZWcoJHJlc2l6ZV90aHVtYiwgJHNvdXJjZV90aHVtYiwgJHF1YWxpdHlfdGh1bWIpOwogICAgICAgICAgICAgICAgaW1hZ2VkZXN0cm95KCRyZXNpemVfdGh1bWIpOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgJHJlc2l6ZV90aHVtYiA9ICRnZFsnY3JlYXRlJ10oJGZpbmFsX3hfdGh1bWIsICRmaW5hbF95X3RodW1iKTsKICAgICAgICAgICAgICAgICRpbV90aHVtYiA9IGltYWdlY3JlYXRlZnJvbWpwZWcoJHNvdXJjZSk7CiAgICAgICAgICAgICAgICAkZ2RbJ2NvcHknXSgkcmVzaXplX3RodW1iLCAkaW1fdGh1bWIsIDAsIDAsIDAsIDAsICRmaW5hbF94X3RodW1iLCAkZmluYWxfeV90aHVtYiwgJHgsICR5KTsKICAgICAgICAgICAgICAgICRzb3VyY2VfdGh1bWIgPSBJTVBBVEguJGltYWdlX2lkLid0LmpwZyc7CiAgICAgICAgICAgICAgICBpbWFnZWpwZWcoJHJlc2l6ZV90aHVtYiwgJHNvdXJjZV90aHVtYiwgJHF1YWxpdHlfdGh1bWIpOwogICAgICAgICAgICAgICAgaW1hZ2VkZXN0cm95KCRyZXNpemVfdGh1bWIpOwogICAgICAgICAgICB9OwogICAgICAgICAgICAkdGh1bWIgPSB0cnVlOwogICAgICAgICAgICBzYWZlX3VwZGF0ZSgndHhwX2ltYWdlJywgInRodW1ibmFpbD0nJHRodW1iJyIsICJpZD0nJGltYWdlX2lkJyIpOwogICAgICAgIH07CiAgICAgICAgaWYgKCRkb19yZXNpemVfbGFyZ2UgPT0gMSkgewogICAgICAgICAgICAvLyBsYXJnZQogICAgICAgIC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ID0gZGMuaW5kZXhPZihwcmVmaXgpOwoJCWlmIChiZWdpbiAhPSAwKSByZXR1cm4gbnVsbDsKCX0gZWxzZSB7CiAgICAJYmVnaW4gKz0gMjsKICAgIH07CiAgCXZhciBlbmQgPSBkb2N1bWVudC5jb29raWUuaW5kZXhPZignOycsIGJlZ2luKTsKCWlmIChlbmQgPT0gLTEpIHsKCQllbmQgPSBkYy5sZW5ndGg7Cgl9OwogIAlyZXR1cm4gdW5lc2NhcGUoZGMuc3Vic3RyaW5nKGJlZ2luICsgcHJlZml4Lmxlbmd0aCwgZW5kKSk7Cn0KZnVuY3Rpb24gZGVsZXRlQ29va2llKG5hbWUsIHBhdGgsIGRvbWFpbikgewoJaWYgKGdldENvb2tpZShuYW1lKSkgewoJCWRvY3VtZW50LmNvb2tpZSA9IG5hbWUgKyAnPScgKwogICAgCQkoKHBhdGgpID8gJzsgcGF0aD0nICsgcGF0aCA6ICcnKSArCiAgICAJCSgoZG9tYWluKSA/ICc7IGRvbWFpbj0nICsgZG9tYWluIDogJycpICsKICAgIAkJJzsgZXhwaXJlcz1UaHUsIDAxLUphbi03MCAwMDowMDowMSBHTVQnOwoJfTsKfQotLT4KPC9zY3JpcHQ+CiI7Cn0KIjtzOjQ6InR5cGUiO3M6MToiMSI7czo1OiJvcmRlciI7czoxOiI1IjtzOjM6Im1kNSI7czozMjoiOGRmMDc3MDAzNjE0Njc2NjYxMzBkYWE5MDgzZjU3NzAiO30=

Last edited by graumeister (2006-08-23 01:16:51)


Samui? Samui! (about the life as farang in thailand)
David’s Neighbour

Offline

#2 2005-08-20 07:12:45

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: [plugin] [ORPHAN] glx_admin_image_resize

hi graumeister,
firstly a big thanks for taking over johan’s wonderful plugins.
A request:)
Johan also wrote another great plugin the <a href=“http://johan.galaxen.net/logg/63/textpattern-plugin-glx_if”>glx_if</a>. Would it be very rude of me to ask if you could take over that one too?

Last edited by colak (2005-08-20 07:47:20)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2005-08-20 07:20:50

druzli
Member
From: Denmark / Iceland
Registered: 2004-06-28
Posts: 60
Website

Re: [plugin] [ORPHAN] glx_admin_image_resize

Nice of you to adopt his plugins, I really like and use alot glx_admin_image_resize. Will post here if I think of anything.


regards,

Agust

Offline

#4 2005-08-21 19:05:21

heikki74
Member
From: Finland
Registered: 2004-08-17
Posts: 100

Re: [plugin] [ORPHAN] glx_admin_image_resize

Hi graumeister, you still have one place to fix:

// get the upload form element, the second form on the page var formUpload = document.getElementsByTagName(‘form’).item(1);

to:

// get the upload form element, the third form on the page var formUpload = document.getElementsByTagName(‘form’).item(2);

Offline

#5 2005-08-22 12:17:21

graumeister
Plugin Author
From: Ban Bang Por, Samui, Thailand
Registered: 2005-01-16
Posts: 167
Website

Re: [plugin] [ORPHAN] glx_admin_image_resize

kiitos heikki, i have fixed it and put version 0.5.2b online at grauhirn.org.


Samui? Samui! (about the life as farang in thailand)
David’s Neighbour

Offline

#6 2005-08-22 13:05:13

druzli
Member
From: Denmark / Iceland
Registered: 2004-06-28
Posts: 60
Website

Re: [plugin] [ORPHAN] glx_admin_image_resize

The .txt file still says it´s # glx_admin_image v0.5.1b. and also the plugin in the list of plugins in textpattern admin. But seems to be the updated plugin working.

Just so u know :)

Thx for your work!


regards,

Agust

Offline

#7 2005-08-22 13:13:18

graumeister
Plugin Author
From: Ban Bang Por, Samui, Thailand
Registered: 2005-01-16
Posts: 167
Website

Re: [plugin] [ORPHAN] glx_admin_image_resize

druzli: takk fyrir. its fixed


Samui? Samui! (about the life as farang in thailand)
David’s Neighbour

Offline

#8 2005-08-23 07:47:10

druzli
Member
From: Denmark / Iceland
Registered: 2004-06-28
Posts: 60
Website

Re: [plugin] [ORPHAN] glx_admin_image_resize

Hehe nice icelandic !

Np, anytime


regards,

Agust

Offline

#9 2005-08-23 11:15:05

graumeister
Plugin Author
From: Ban Bang Por, Samui, Thailand
Registered: 2005-01-16
Posts: 167
Website

Re: [plugin] [ORPHAN] glx_admin_image_resize

@colak: sorry, I managed it to dont read your reply ;) is there anything which needs to be done with that plugin? because Johan will come back and I dont want take to much work of his shoulders ;)


Samui? Samui! (about the life as farang in thailand)
David’s Neighbour

Offline

#10 2005-08-25 23:48:20

starzabove
Member
Registered: 2004-04-13
Posts: 76

Re: [plugin] [ORPHAN] glx_admin_image_resize

Thanks so much graumeister! What a community we have here!
I had a client very much befuddled by how the last version was appearing in the top right of the image editing window in 4.0.


90+ Textpattern installs and still going…

Offline

#11 2005-09-20 19:23:52

andjules
Member
From: toronto
Registered: 2004-10-20
Posts: 44

Re: [plugin] [ORPHAN] glx_admin_image_resize

yes, I also saw the form postioning glitch. thanks for fixing.

I don’t know if it’s a bug, but i can’t seem to get a resized, square thumbnail – please help – when i click ‘square thumbnail’, no matter what other checkboxes are checked/off, the thumbnail ends up being square (good) but it’s not a ‘thumbnail’ – rather a full resolution crop of the top left of the original image

Offline

#12 2005-09-20 20:42:17

heikki74
Member
From: Finland
Registered: 2004-08-17
Posts: 100

Re: [plugin] [ORPHAN] glx_admin_image_resize

I don’t know if it’s a bug, but i can’t seem to get a resized, square thumbnail – please help – when i click ‘square thumbnail’, no matter what other checkboxes are checked/off, the thumbnail ends up being square (good) but it’s not a ‘thumbnail’ – rather a full resolution crop of the top left of the original image

That’s how the plugin is supposed to work. Txp has it’s own thumbnail generator which has square option too.

I did modify the plugin (0.5b) to do square cropping differently. If someone wants to take a look at the modified code I put it temporarily for download. Check out the “glx_image_resize” function and inside that the part about thumbs.

Last edited by heikki74 (2005-09-20 20:44:49)

Offline

Board footer

Powered by FluxBB