Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-02-21 00:12:56

hablablow
Member
From: Paris
Registered: 2004-12-13
Posts: 309
Website

Force the creation of a 40x40 cropped thumbnail on upload

How do I force the creation of a 40×40 cropped thumbnail on upload and remove the ability to modify it in the image management page ?

In the image management page that means: no more thumbnail replace or change values.

Pshht it’s all gone: you upload your picture, 40×40 cropped thumbnail is created, you pack your sandwich and you go fishing.


_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__

Hablablow + Webdesignofficina

Offline

#2 2010-02-21 00:27:24

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,000
Website GitHub

Re: Force the creation of a 40x40 cropped thumbnail on upload

Maybe you could set it yourself to 40 × 40 px so that all subsequent thumbnails are automatically generated as standard, then use something like jmd_admin_js to hide the entire thumbnail div with a jquery hide statement. It will still be there but most people won’t be aware of it.

bot_write_tab_customize does something similar but only for the write tab. bot_privs has some further settings but I don’t think it is that fine grain.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2010-02-21 02:58:22

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: Force the creation of a 40x40 cropped thumbnail on upload

jakob wrote:

Maybe you could set it yourself to 40 × 40 px so that all subsequent thumbnails are automatically generated as standard, then use something like jmd_admin_js to hide the entire thumbnail div with a jquery hide statement. It will still be there but most people won’t be aware of it.
bot_write_tab_customize does something similar but only for the write tab. bot_privs has some further settings but I don’t think it is that fine grain.

Yes, Jakob is perfectly right. You should use jmd_admin_js.
Otherwise a simpler solution is to install ied_hide_in_admin wich has just an option for that (with the added advantage of having the ability to hide it only for some privs level)

Last edited by redbot (2010-02-21 03:00:09)

Offline

#4 2010-02-21 10:59:16

masa
Member
From: North Wales, UK
Registered: 2005-11-25
Posts: 1,095

Re: Force the creation of a 40x40 cropped thumbnail on upload

Keep in mind that thumbnails at 40px square – although looking neat – aren’t very useful, especially when you go through your images in the backend trying to find something.

I usually create thumbs at around 160px and use CSS to scale them down on the live site.

Offline

#5 2010-02-22 09:36:23

hablablow
Member
From: Paris
Registered: 2004-12-13
Posts: 309
Website

Re: Force the creation of a 40x40 cropped thumbnail on upload

Thank you folks for your answers I’m already using these two plugins.

They are not my favorite piece of cake because they simply hide parts of Txp with Javascript: turns your JS off and the magic does not happen.

I was more thinking about a Textpattern core code tweak or hack.

For the thumbnail there should be a default hard-coded value somewhere in the Txp code…

To hide parts of the admin is it a good idea – is there a simple way to try to handle it from within Txp code directly ?

Thanks for your precious help.

Last edited by hablablow (2010-02-22 09:40:05)


_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__

Hablablow + Webdesignofficina

Offline

#6 2010-02-22 14:06:13

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,315

Re: Force the creation of a 40x40 cropped thumbnail on upload

Guilleaume, try this:

Open /textpattern/include/txp_image.php
Around line 420 should be this block:


			tr(
				td(
					join('',
						array(
							($thumbnail)
							? 	startTable('image-thumbnail').
									tr(
										td($thumb).
										td(dLink('image','thumbnail_delete','id',$id))
									).
								endTable().br
							: 	'',
							upload_form(gTxt('upload_thumbnail'),'upload_thumbnail',
								'thumbnail_insert','image',$id,$file_max_upload_size, 'upload-thumbnail', '')
						)
					)
				)
			),

Replace with nothing. !Keep a copy of the original file!


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#7 2010-02-22 16:11:21

hablablow
Member
From: Paris
Registered: 2004-12-13
Posts: 309
Website

Re: Force the creation of a 40x40 cropped thumbnail on upload

Danke Uli !!! I’ll let you know what happens when I do this… Hopefully there is no risk at breaking something there…


_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__

Hablablow + Webdesignofficina

Offline

#8 2010-02-22 17:38:04

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Force the creation of a 40x40 cropped thumbnail on upload

Just an idea but could you hide it using CSS in a custom Admin Side Theme? Easier to upgrade in the future that way.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#9 2010-02-22 17:47:44

hablablow
Member
From: Paris
Registered: 2004-12-13
Posts: 309
Website

Re: Force the creation of a 40x40 cropped thumbnail on upload

MMmmmmm… That’s pretty clever indeed Matt… Thanks !


_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__

Hablablow + Webdesignofficina

Offline

Board footer

Powered by FluxBB