Any idea how to test wether the cropBox actually contains art?

I'm  exporting large drawings as tiles for a google maps project. I do so by moving the cropBox and exporting the covered area as PNGs. Works great so far but ... since the drawing is kind of organic and does not fill the whole area i'm exporting i have many (most) PNGs be just plain white. These just fill my disk space and i have to have them removed later on anyways. My question is therefore wether there is a way to test (Illustrator CS3 / JavaScript) if the cropBox actually contains/covers anything?

Should work with something like this ...didn't get the time to test so if anything goes wrong post/curse here :
var v_doc = app.activeDocument;
var cropBox = v_doc.cropBox;
function isInsideCropBox() {
    for(j = v_doc.pageItems.length - 1; j >= 0; j--) {
        var t_vBounds = v_doc.pageItems[j].visibleBounds;
        if(Inside(cropBox[0], cropBox[1], t_vBounds[0], t_vBounds[2], t_vBounds[3], t_vBounds[1]) || 
           Inside(cropBox[2], cropBox[3], t_vBounds[0], t_vBounds[2], t_vBounds[3], t_vBounds[1]) ||
           Inside(t_vBounds[0], t_vBounds[1], cropBox[0], cropBox[2], cropBox[3], cropBox[1]) || 
           Inside(t_vBounds[2], t_vBounds[3], cropBox[0], cropBox[2], cropBox[3], cropBox[1])){
            return true;
        } else return false;
function Inside( x, y, l, r, b, t ) // x,y coords of the point we want to check if is within rectangle, l - left, r - right, b - bottom, t - top; not quite an ellegant solution but should work for now
     var _b = x >= l && x <= r;
     if(y<0 && b<0) _b &= -y <= -b; else _b &= y <= b;
     if(y<0 && t<0) _b &= -y >= -t; else _b &= y >= t;
     return _b;
if(isInsideCropBox()) {
    alert("TRUE");
} else {
    alert("FALSE");
cheers;

Similar Messages

  • Hi guys, the MUSIC app on my 2 iPad IOS 5 starts up playing music on its own very often. Any idea how I can kill the b....rd???

    Hi Guys, Apple's MUSIC app on my iPad 2 iOS 5 starts up playing music on its own frequently, I have to stop it evy time. Any idea how I can kill the b....d?? Thank you!

    Make sure that you have quit the app when you finish using it. To do so press the Home button once to return to the Home screen. Then press the Home button twice to reveal the open apps under the Dock. Tap and hold the Music app until it begins to jiggle and a appears in the upper left corner of the icon. Tap the to quit the app. Tap the screen or press the Home button to return the Dock to it original position.

  • I did a trial using one email, then purchased a subscription using a different email. Every time I try to open a downloaded app it tells me that my trial has expired and only offers me the option to purchase it. Any ideas how I can access the subscription

    I did a trial using one email, then purchased a subscription using a different email. Every time I try to open a downloaded app it tells me that my trial has expired and only offers me the option to purchase it. Any ideas how I can access the subscription I just paid for?

    Sign out from Creative Cloud desktop application and Sign in with email ID using which you had purchased subscription .
    https://helpx.adobe.com/creative-cloud/kb/sign-in-out-creative-cloud-desktop-app.html
    Then launch CC apps and try to activate.
    Still face issue , let me know 

  • Hi, I like using Firefox more than I do IE, but I've been using IE lately because of all the pop-up pages I'm getting. Do you have any idea how I can stop thes

    Hi,
    I like using Firefox more than I do IE, but I've been using IE lately because of all the pop-up pages I'm getting. Do you have any idea how I can stop these pop-up tabs from happening?
    Thanks

    Do a malware check with some malware scanning programs on the Windows computer.<br>
    Please scan with all programs because each program detects different malware.<br>
    All these programs have free versions.
    Make sure that you update each program to get the latest version of their databases before doing a scan.
    *Malwarebytes' Anti-Malware:<br>http://www.malwarebytes.org/mbam.php
    *SuperAntispyware:<br>http://www.superantispyware.com/
    *Microsoft Safety Scanner:<br>http://www.microsoft.com/security/scanner/en-us/default.aspx
    *Windows Defender: Home Page:<br>http://www.microsoft.com/windows/products/winfamily/defender/default.mspx
    *Spybot Search & Destroy:<br>http://www.safer-networking.org/en/index.html
    *AdwCleaner:<br>http://www.bleepingcomputer.com/download/adwcleaner/<br>http://www.softpedia.com/get/Antivirus/Removal-Tools/AdwCleaner.shtml
    *Kasperky Free Security Scan:<br>http://www.kaspersky.com/security-scan
    You can also do a check for a rootkit infection with TDSSKiller.
    *Anti-rootkit utility TDSSKiller:<br>http://support.kaspersky.com/5350?el=88446
    See also:
    *"Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked

  • Does anyone have any idea how to find out the version of weblogic plugin

    Does anyone have any idea about how to find out the current version of weblogic plugin used to connect from webserver to weblogic server?
    I could not find version in plugin directory.
    it's the same one that came prepackaged with Weblogic 9.2. we haven't change it.
    Sun One 6.1 SP6
    Weblogic 9.2
    Solaris 5.10
    Edited by: 985608 on 01-feb-2013 8:20
    Edited by: 985608 on 04-feb-2013 6:25
    Edited by: 985608 on 04-feb-2013 6:27

    Hi,
    You can find version of weblogic plugin using below command.
    strings <plugin module file> | grep -i wlsplugins
    Mark if this helps.
    Regards,
    Kishore

  • Any idea how to speed up the performance of my Macbook Pro?

    I bought a MacbookPro in 2008, it's been great till now when I updated it on Snow Leopard first and Lion later on, has slowed down since.
    I was wonder if there is any way to speed it up. I've been using the CleanGenius Free program to clean it, but it doesn't improve much.
    Any Idea?
    MacBook Pro
    Processor  2.2 GHz Intel Core 2 Duo
    Memory  2 GB 667 MHz DDR2 SDRAM
    Graphics  NVIDIA GeForce 8600M GT 128 MB
    Software  Mac OS X Lion 10.7.4 (11E53)
    Cheers

    I would avoid such cleaning programs.
    Have you adequate free disk space? Allow at least 20GB.
    Have you enough RAM? Use Activity Monitor, System Memory tab to see if you have some free RAM. If not, watch the page ins/page outs figures - if page outs climbs rapidly, you probably need more RAM.
    In Activity Monitor, look to see which processes are using most CPU.
    Do a system restart every day, as this helps flush out temp files, log files etc.

  • I like the new version of Firefox 4, but have slowest problem with the company bluecoat proxy. I have change different setting in the about:config. Any Ideas how to to fix the slowest.

    I like the new version of Firefox 4, But have slowing problem with the bluecoat proxy. I have change different setting in the about:config with no luck. Any ideas why it's moving so slow would help?
    network.automatic-ntlm-auth.trusted-uris = proxysg
    network.negotiate-auth.delegation-uris=proxysg
    network.negotiate-auth.trusted-uris=proxysg
    network.negotiate-auth.allow-proxies = True
    network.ntlm.send-lm-response = True
    network.automatic-ntlm-auth.allow-proxies=True

    You can also look at Tab Mix Plus.
    Tab Mix Plus: https://addons.mozilla.org/firefox/addon/1122

  • All my photos have another photo overlying the original photo any ideas how i can fix the problem?

    unexpectedly all my photos are covered up by another photo(the same one).When I click on the photo the one underneath is revealed. How did this happen and how can i fix the problem?

    Launch iPhoto with the Command + Option keys held down and run the option to rebuild the thumbnail files.  With iPhoto 8 (09) it would be the two options circled in red in this screenshot:
    It could take more than one attempt to get them all.
    OT

  • Lost my apps when I upgraded my iPhone 4 with ios6 any idea how I can get the apps back

    Lost my apps when I upgraded my iPhone 4 with ios6 how do I get them to reflect on my home screen

    Another way is to just easily go the App Store on your iphone or ipad and look under purchased arrow.  Click on it and all your apps you've downloaded or purchased are right there, no connection needed.  Just hit the icloud button and download them.  The reason I think you "lost" them is you forgot to back them up to your original back up on your mac in itunes. 
    I can now see all my apps via icons right in itunes, which is cool for me.
    If your apps are in itunes then they should, should have backed up to your restore.  If they didn't that's weird.
    Too many people are screwing up the update by not SLOWLY reading the instruction options when they begin, not Apples fault.  Also, so many people are impatient and thinking that when it says "restoring" "backing up" they freak and think they are losing everything and prematurely stop the upgrade, unplug or whatever.
    People take a deep breath.  This is a MAJOR undertaking for Apple and all of us. 
    Perspective -  over 100 Million iOS devices.... Think about it. No company has attempted to do what they are doing -- all at once. 

  • I found an IPod and wish to contact the user using the SrL No any ideas how I do this, the IPod is locked.

    I found an IPod and wish to return it to the owner.  Anyone know how to get the owner dettails from the serial number?

    Sorry, but there is no way you can get owner information from the serial number. The best route is to turn the iPod into your local police department.
    Regards.

  • Hello. I can not remember my security question answers, and I no longer have the email that they are trying to resend them to. Any idea how I can recover the answers?

    PLEASE HELP.
    I can not remember the answers to the security questions and I no longer have the email that Apple is trying to send the answers to. Is there a way to recover the answers or have the email sent to a different address?
    Thanks

    See Kappy's previous write-up.
    Some Solutions for Resetting Forgotten Security Questions: Apple Support Communities

  • Does anyone have any idea how do i key in number that contains 20digit, 17 decimal places?

    I need to key in a number that contains at least 17 decimal places using numeric digit control and i need to use expression note as well. Can anyone help?

    After laying down a numeric control right click on it and select "Format and Precision..." to change the number of decimal places. You can also right click and change the "Representation" of the numeric control. By default it will be a DBL which is a 64 bit decimal number with an approximate range of 10**(-308) to 10**308. This is about 15 decimal digits of precision. I know SGL will only give you 10**(-38)to 10**38, which is about 7 decimal digits of precision. Neither of these will cut it for what you are trying to do.
    I would recommend using the Extended Precision (EXT) representation. According to the linked document La
    bVIEW's implementation of the Extended Precision follows the IEEE 80-bit spec(on Windows OSes). Supposedly even the IEEE 128-bit spec(not implemented on the Windows OSes)only gets you 19 decimal places but I am not sure what the limitations of LabVIEW's implementation are. (I found a good table in the LabVIEW help title, "Numeric Data Types Table".)
    I was able to successfully get 17 digits after the decimal point but that was with a leading 0 only before the decimal point. I think you may just be approaching the limit of how a number can be represented in this programming language.
    Anyone else?
    -scraggs99

  • I want to sync tasks in Outlook with my iPhone. I have tried Toodledo (not good) and Todo. Todo works, but it cuts off most of the text. I only get the beginning of my (long) lists. Any ideas how I can solve this problem?

    I want to sync tasks in Outlook with my iPhone. I have tried Toodledo (not good) and Todo. Todo works, but it cuts off most of the text. I only get the beginning of my (long) lists. Any ideas how I can solve this problem? I starting to regret that I switched to iPhone...

    Usually if you have some kind of hardware failure there is some beeping during POST or most motherboards now have LED indicators to produce and error message based on the type of failure
    So if its bad memory, not place properly, mismatched, processor not inserted properly, mismatched voltage or voltage connector not present etc it beeps or generates the error id.
    Power supplies can be tested for failure. There are some walk throughs for testing just them with a switch, paperclip or a jumper (I'd suggest not doing this if you are not familiar with the dangers of electricity).
    Memory can be tested with memory diagnostics programs like Memtest+
    Processors can overheat if the proper precautions have not been taken usually you will get a POST beep or error code for that.
    If the motherboard has no response then do the basics first:
    Check power connectors and power supply. Once you determine that is not the case move on to other items like graphics cards in all the way or memory.

  • Having a MBPr late 2013 and having a sound problem the sound does not come tom the headphones even its all the way up and when i remove the headphones it docent come out the internal speaker either ? any idea how i fix this?

    the sound do not come out the headphones sometimes altho its all the way up in the setting and when i remove the headphones the sound doesnt come from the internal speaker either and only a reboot fixes the problem and thats annoying! any idea how tto fix this?

    Hello. I've been able to play sound without problems through headphones or external speakers to date - the output always switched to these automatically until today. Now, sound output continues through internal speakers even if I plug in headphones or external speakers.
    - I tested the headphones and speakers on other devices: they work fine.
    - When I plug in headphones or speakers into the audio output port (I have verified that I'm not using the input jack) the devices are not detected and are not listed under the output tab in system preferences-sound.
    I concluded from this that I probably had a problem with the audio port, so to test that I tried the following. I plugged a powered multi-USB device with ports for microphone line-in and headphone line-out into the USB port and switched it on. I verified that it was working by plugging a USB stick into the multi-USB device - this was recognised successfully, so the device was clearly working. I then plugged in headphones and speakers into the audio line-out on the multi USB device - but still no sound came through them (and tey were not listed among output devices) and the Mac continued using internal speakers.
    What should I do? Does the latter test suggest that the problem does not lie with the audio port, or is my test not conclusive? What would you advise?
    Many thanks indeed!
    NG

  • I deleted safari off my computer. I can not access the Internet at all. Any idea how to wt it back?

    I deleted safari off my computer. I can not access the Internet at all. Any idea how to wt it back?
    The app is not found at all in my computer

    If you’ve deleted or damaged the Safari application, you don’t have a backup, and you don’t have another web browser, proceed as follows.
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ If you’re running OS X 10.7 or later, open LaunchPad. Click Utilities, then Terminal in the page that opens.
    Copy or drag — do not type — the line below into the Terminal window:
    open /Library/Application\ Support/Apple/.SafariArchive.tar.gz
    Press return. The Archive Utility application will launch and run briefly. When it exits, enter the following line in the Terminal window the same way as above:
    sudo cp -R Downloads/.SafariArchive/Applications/Safari.app /Applications/
    Select the whole line by triple-clicking it, then copy or drag it to the Terminal window. Press return. This time you’ll be prompted for your login password, which won’t be displayed when you enter it.
    There should be no output from the above command. If that’s the case, launch Disk Utility, select the boot volume and run “Repair Permissions” (not “Repair Disk.”) This is one of the few times there’s a reason to do that.
    Next, two more commands in Terminal:
    chmod -R -N Downloads/.SafariArchive
    rm -r !$
    Those are two separate lines; press return after each one. You can then quit Terminal.
    Test Safari. If it works, you’re done. If not, you did some other damage to your system and need to reinstall.

Maybe you are looking for

  • Chat user is not getting message from the other users

    In my application when user [A] initiate the chat with user[B]  , I am facing following issues -          User[B] is not getting initiation notification so that I am unable to open chat pod for user [A] on user[B] application -          Due to above

  • Dr. Watson Error on exiting weblogic server 6.1

    Hi, I sometimes get the Dr.watson error when I stop my weblogic server. The details are given below. I have weblogic 6.1 Windows 2000 5.00.2195 Service pack 2 Memory=392mb The message from Dr. Watson is:- "Dr. watson was unable to attach to the proce

  • Convert numeric value to display as text based on record in another table? ASP/VB

    I have an orders table: orderID (PK) pickupname pickupaddress pickupregion (numeric) pickuppostcode deliveryname deliveryaddress deliveryregion (numeric) deliverypostcode I also have a regions table: regionID regionname On my ASP page, I would like t

  • Move Exchange mailboxes to O365 via PowerShell script

    We are having a problem getting our scripting to work. We have to move 200-300 mailboxes (on a daily basis) to O365. This is an ongoing process. Currently we have over 700,000 mailboxes in the cloud. (Those numbers are correct.) We want to automate t

  • Photoshop Photography Program downloaded on 2 computers?

    I would like to do the program, the $10 monthy one, but I would like to know if I could download the Photoshop CC onto 2 diffent computers. Thats pretty much all I need to know. Thanks