# Name: soo_thumb_atts v0.2.1 # Type: Admin only plugin # Update thumbnail h/w attributes # Author: Jeff Soo # URL: http://ipsedixit.net/txp/ # Recommended load order: 5 # ..................................................................... # This is a plugin for Textpattern - http://textpattern.com/ # To install: textpattern > admin > plugins # Paste the following text into the 'Install plugin' box: # ..................................................................... YToxMTp7czo0OiJuYW1lIjtzOjE0OiJzb29fdGh1bWJfYXR0cyI7czo2OiJhdXRob3IiO3M6 ODoiSmVmZiBTb28iO3M6MTA6ImF1dGhvcl91cmkiO3M6MjU6Imh0dHA6Ly9pcHNlZGl4aXQu bmV0L3R4cC8iO3M6NzoidmVyc2lvbiI7czo1OiIwLjIuMSI7czoxMToiZGVzY3JpcHRpb24i O3M6MzE6IlVwZGF0ZSB0aHVtYm5haWwgaC93IGF0dHJpYnV0ZXMiO3M6NDoiaGVscCI7czoy NzUxOiI8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgpkaXYjc2VkX2hlbHAgcHJlIHtwYWRkaW5n OiAwLjVlbSAxZW07IGJhY2tncm91bmQ6ICNlZWU7IGJvcmRlcjogMXB4IGRhc2hlZCAjY2Nj O30KZGl2I3NlZF9oZWxwIGgxLCBkaXYjc2VkX2hlbHAgaDIsIGRpdiNzZWRfaGVscCBoMywg ZGl2I3NlZF9oZWxwIGgzIGNvZGUge2ZvbnQtZmFtaWx5OiBzYW5zLXNlcmlmOyBmb250LXdl aWdodDogYm9sZDt9CmRpdiNzZWRfaGVscCBoMSwgZGl2I3NlZF9oZWxwIGgyLCBkaXYjc2Vk X2hlbHAgaDMge21hcmdpbi1sZWZ0OiAtMWVtO30KZGl2I3NlZF9oZWxwIGgyLCBkaXYjc2Vk X2hlbHAgaDMge21hcmdpbi10b3A6IDJlbTt9CmRpdiNzZWRfaGVscCBoMSB7Zm9udC1zaXpl OiAyLjRlbTt9CmRpdiNzZWRfaGVscCBoMiB7Zm9udC1zaXplOiAxLjhlbTt9CmRpdiNzZWRf aGVscCBoMyB7Zm9udC1zaXplOiAxLj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