Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1] 2 3 4   Go Down

Author Topic: NEW MODPACK ADDITION: Manually crop thumbs / replace thumbs for images and media  (Read 74402 times)

0 Members and 1 Guest are viewing this topic.

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt

included in modpack 1.4.14

This is an addition for the modpack 1.4.13.

Installation:
Download (attached to this thread) unzip and upload the archive contents to your server replacing the existing files.

This mod is in an early state. Therefore be aware of possible bugs and backup your files before using this. The language is still hardcoded, means no lang file support so far. Also it's working for now only with GD2. ImageMagick support will follow later.
If you want to create a thumb for a pic from a second image, then make sure it has the same extension as the original file. If the orig is jpg, then the thumb base image has to be jpg too. For media files you can use jpg, gif or png.

Please tell me about issues you may find.

Credits:
For this mod I've used the jsCropperUI (BSD License). It's based on the Prototype JavaScript framework and script.aculo.us

How to use:
1. Either next to an album click 'edit files' or below the intermediate image click 'edit file information'. Now you'll find above the thumb a link 'change thumb'. That's not really new for modpack users but read on.
2. Click the change thumb link and find the 'changeThumb.php' interface. Now you not only can create new thumbs for media files but also for images. You can upload new images or (if the original is an image) create the thumb from the image again. Also you can decide if you want to let the system automatically create thumbs or do that manually to find the best part of the image.
3. If you decide to upload a new image to create a thumb from that you have the possibility to check the checkbox 'Manually crop after upload'. If you do that, manually cropping is enabled, if not, the system auto crops the image (of course that's faster). If you manually crop, the image loads and a box appeares that indicates the area that will be cropped. This area has a min size of your thumb dimensions and will keep the aspect. So far I've tested with the modpacks 'exact size' thumbs and did some quick'n dirty tests with 'width' and 'height'. When you've found the part of the image you want to use as thumb click the 'save' button. Done... you just created a new custom thumb for your picture or media file.
4. a) Either upload a image to use as base for cropping
      aa) manually crop (checkbox 'Manually crop after upload')
      bb) auto crop (don't check 'Manually crop after upload')
    b)
       aa) click (if the orig is an image) 'Use the original image as base to crop the thumb' and you can manually crop the thumb from the original image
     c) check the checkbox 'Remove current thumb' and click the button 'Remove current thumb' to delete the custom thumb. If it's a media file, then the media icon will display, if it's an image... then no thumb will display anymore.

Have a look at the screenshots in the next posts. The mod is attached to this post.

I've created a user on my demo site for you to play with this. Click 'my gallery' when logged in or browse to the user 'croptest's personal gallery. These four images you can edit.

user: croptest
pass: cropper

direct link to the user gallery of croptest: http://stramm.st.funpic.org/index.php?cat=10307

Version 1.1 uploaded today 10-14-2007
 - cropping preview added
 - lang file support (added the necessary code to the existing lang files [french, greek, italian, german] but not translated from english)
 - ImageMagick support
 - some other minor tweaks (eg. you can start cropping double clicking on the crop area instead of moving the mouse to the submit button and clicking that)

Version 1.2 uploaded 10-16-2007
  - added a link within editpics and editonepic in addition to 'change thumb' that allows to directly jump to the thumb cropping using the orig image as base
  - fixed a glitch in the cropper when using 'max aspect'
  - when either using max aspect, width or height as aspect ration now the initial crop area is the thumb size and not anymore the fullsized width/ hight
  - added 'change thumb' and 'crop thumb' to the lang file, the above existing modpack files have been upfated (using english)
  - added lang fallback

Version 1.3 uploaded on 10-16-2007 as well
  - when viewing a non image file in editpics now the 'crop link' won't appeare anymore. As a media file doesn't have an original, fullsized image, you can't crop an image from that. So 'change thumb' is the only valid possibility (upload and auto/ or manually crop a thumb)
  - fixed another glitch when using 'max aspect'

Version 1.3.1 uploaded on 10-18-2007
  - fixed ImageMagick support
  - some minor improvements

language contributions are welcome!
« Last Edit: November 08, 2007, 02:35:10 pm by Stramm »
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: NEW: Manually crop thumbs / replace thumbs for images and media files
« Reply #1 on: October 13, 2007, 07:34:43 pm »

Pic 1:
click edit files next to an album

Pic 2:
The edit files dialog... click 'change thumb' above the thumb

Pic 3:
That's how the 'changeThumb.php' interface looks...

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: NEW: Manually crop thumbs / replace thumbs for images and media files
« Reply #2 on: October 13, 2007, 07:37:59 pm »

Pic 4:
now click the button 'Use the original image as base to crop the thumb'

Pic 5:
the manual crop interface appeares, the image loads, if the original image is bigger than your intermediate settings, the script will resize it... therefore it may need some secs. If you use watermarks, then the script grabs the backup image so you won't have that watermark on the image you want to crop your thumb from

Pic 6:
that's how it looks when you've made your selection... now click 'save'

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: NEW: Manually crop thumbs / replace thumbs for images and media files
« Reply #3 on: October 13, 2007, 07:41:39 pm »

Pic 7:
Yippie, the new custom cropped thumb

Pic 8:
now we have a look at the upload area, that's espescially for media files, but you also can use it for images. You can upload another image and create the thumb from that.

Pic 9:
I've chosen a pic and checked 'Manually crop after upload'. That way I can crop manually. If I do not click the checkbox, the system will create the thumb for me .

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt

The crop interface with preview area (v1.1)

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt

updated today 10-16-2007 to v1.3

Mimer

  • Translator
  • Coppermine frequent poster
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 129
    • Fjotte

Hmmm.
I get this error:
Critical error
The file './albums/edit/thumb_Best_Of_Stocking_Secrets_Scene_0001.jpg-120-90-0-0-120-90' can't be inserted in the album

Mimer  8)
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt

please post a link, testuser account and make sure I can upload a pic somewhere
useful also are the 'upload troubleshooting' settings
http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#upload_trouble

Mimer

  • Translator
  • Coppermine frequent poster
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 129
    • Fjotte

Coppermine install: http://fjotte.dk/gal_da/
Forum install:
Coppermine version: cpg1.4.13
Forum version:
Test user account: tester / tester

Both DIR and files are 777 chmod

Size of thumbs are 120x120 px max and Coppermine setting is MAX 120px

Made an album called Stramm you can post in  ;)

Mimer  8)
Logged

Mimer

  • Translator
  • Coppermine frequent poster
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 129
    • Fjotte

I cannot update thumbs either (that is for videofiles):

Update thumbs and/or resized photos (1)
What should be updated (2):
x Only thumbnails (mini and regular)

I get this error:
ERROR creating:$thumb
ERROR creating:$thumb
ERROR creating:$thumb
ERROR creating:$thumb
ERROR creating:$thumb
 
Mimer  8)
Logged

Mimer

  • Translator
  • Coppermine frequent poster
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 129
    • Fjotte

I get this error when I try to change thumb:

Error executing ImageMagick - Return value: 127

Mimer  8)
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt

There's a bug with ImageMagick support... need to find and fix this. Seems I have to recode some parts. In the meanwhile you can use GD2.

The admin_tools problem shouldn't be related (and is a question on it's own, new thread)

Mimer

  • Translator
  • Coppermine frequent poster
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 129
    • Fjotte

OK. Changed to GD2.
It's like I still cannot change thumbs for mediafiles, that is videofiles.
Picture files works OK.

Mimer  8)
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt

as said, the admin tools problem is not related and you should have started a new thread... but to give you the answer... expected behaviour and exactly what an unmodded copermine is doing as well. Garbbing a fullsized image and creating a thumb. If it's a media file, then there is no fullsized pic and therefore a thumb can't be created... that's why I coded this mod. You can upload images and use them to create thumbs for media files. And you can create better thumbs cause you now can chose what part of the image to use for the thumb (even for non media files).

Mimer

  • Translator
  • Coppermine frequent poster
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 129
    • Fjotte

Sure I understod that about the admin tools. I'll ask about that elsewhere.
It's related to my first question and your mod: Manually crop thumbs / replace thumbs for images and media
When I try to replace thumb for a videofile using your mod (and GD2 setting) the thumb isn't change I get the default WMV thumb.

Mimer  8)
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt

worked for me... but it grabs the 'old' icon from cache and displays it while the custom thumb is already up. Hmm... I'll see if there's a possibilty

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt

uploaded a new version, fixed ImageMagick support

Mimer

  • Translator
  • Coppermine frequent poster
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 129
    • Fjotte

Problem solved.
My thumbs extension were lowercase and videofiles extension.
Every thing works perfect now.
Thanks for all your support Stramm.

Mimer 8)
Logged

Stramm

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt

ahh.. I see, next version will have a check for that

Mimer

  • Translator
  • Coppermine frequent poster
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 129
    • Fjotte

Hi

I'm translating language file for modpack v1 for CPG 1.4.13 to Danish.
Anything to change for this mod addition?

Mimer  8)
Logged
Pages: [1] 2 3 4   Go Up
 

Page created in 0.035 seconds with 20 queries.