Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Only keep thumbnail and erase original image ?
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: Only keep thumbnail and erase original image ?
It won't ever be supported, because it would break stuff like rebuild thumbnails (meaning you're stuck with whatever thumbnail you generate).

If you absolutely must have it though, maybe try this code edit (I have not tested it so don't know if it works - please test it before using it).
In inc/xthreads/xt_upload.php, find

PHP Code:
1
2
3
4
5
6
7
8
	if(!empty($img_dimensions) && !empty($tf['fileimgthumbs'])) {
		// generate thumbnails
		$attacharray['thumbs'] = xthreads_build_thumbnail($tf['fileimgthumbs'], $attacharray['aid'], $tf['field'], $new_file, $path, $month_dir, $img_dimensions);
		$attacharray['thumbs']['orig'] = $origdimarray;
		$attacharray['thumbs'] = serialize($attacharray['thumbs']);
	}
	
	return $attacharray;

Replace with

PHP Code:
1
2
3
4
5
6
7
8
	if(!empty($img_dimensions) && !empty($tf['fileimgthumbs'])) {
		// generate thumbnails
		$attacharray['thumbs'] = xthreads_build_thumbnail($tf['fileimgthumbs'], $attacharray['aid'], $tf['field'], $new_file, $path, $month_dir, $img_dimensions);
		$attacharray['thumbs']['orig'] = $origdimarray;
		$attacharray['thumbs'] = serialize($attacharray['thumbs']);
	}
	@unlink($new_file);
	return $attacharray;


It's an ugly hack, and a side effect is that it may still generate junk directories etc, but it solves the space problem at least.


My Blog
10-25-2014 10:34 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
RE: Only keep thumbnail and erase original image ? - ZiNgA BuRgA - 10-25-2014 10:34 PM

 Standard Tools
Forum Jump: